mirror of
https://github.com/cosmos/cosmjs.git
synced 2025-03-10 21:49:15 +00:00
Convert eslint config to .js to set parserOptions.project/.tsconfigRootDir
This commit is contained in:
parent
8cde21b15c
commit
04e9f64278
58
.eslintrc.js
Normal file
58
.eslintrc.js
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
module.exports = {
|
||||||
|
env: {
|
||||||
|
es6: true,
|
||||||
|
jasmine: true,
|
||||||
|
node: true,
|
||||||
|
worker: true,
|
||||||
|
},
|
||||||
|
parser: "@typescript-eslint/parser",
|
||||||
|
parserOptions: {
|
||||||
|
ecmaVersion: 2018,
|
||||||
|
project: "./tsconfig.json",
|
||||||
|
tsconfigRootDir: __dirname,
|
||||||
|
},
|
||||||
|
plugins: ["@typescript-eslint", "prettier", "simple-import-sort", "import"],
|
||||||
|
extends: [
|
||||||
|
"eslint:recommended",
|
||||||
|
"plugin:@typescript-eslint/recommended",
|
||||||
|
"prettier/@typescript-eslint",
|
||||||
|
"plugin:prettier/recommended",
|
||||||
|
"plugin:import/typescript",
|
||||||
|
],
|
||||||
|
rules: {
|
||||||
|
curly: ["warn", "multi-line", "consistent"],
|
||||||
|
"no-console": ["warn", { allow: ["error", "info", "warn"] }],
|
||||||
|
"no-param-reassign": "warn",
|
||||||
|
"no-shadow": "warn",
|
||||||
|
"prefer-const": "warn",
|
||||||
|
"spaced-comment": ["warn", "always", { line: { markers: ["/ <reference"] } }],
|
||||||
|
"import/no-cycle": "warn",
|
||||||
|
"simple-import-sort/sort": "warn",
|
||||||
|
"@typescript-eslint/explicit-function-return-type": ["warn", { allowExpressions: true }],
|
||||||
|
"@typescript-eslint/no-empty-function": "off",
|
||||||
|
"@typescript-eslint/no-empty-interface": "off",
|
||||||
|
"@typescript-eslint/no-explicit-any": "off",
|
||||||
|
"@typescript-eslint/no-unused-vars": ["warn", { argsIgnorePattern: "^_", varsIgnorePattern: "^_" }],
|
||||||
|
"@typescript-eslint/no-use-before-define": "warn",
|
||||||
|
},
|
||||||
|
overrides: [
|
||||||
|
{
|
||||||
|
files: "**/*.js",
|
||||||
|
rules: {
|
||||||
|
"@typescript-eslint/no-var-requires": "off",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
files: "**/*.spec.ts",
|
||||||
|
rules: {
|
||||||
|
"@typescript-eslint/no-non-null-assertion": "off",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
files: "jasmine-testrunner.js",
|
||||||
|
rules: {
|
||||||
|
"@typescript-eslint/camelcase": ["error", { properties: "never" }],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
@ -1,56 +0,0 @@
|
|||||||
{
|
|
||||||
"env": {
|
|
||||||
"es6": true,
|
|
||||||
"jasmine": true,
|
|
||||||
"node": true,
|
|
||||||
"worker": true
|
|
||||||
},
|
|
||||||
"parser": "@typescript-eslint/parser",
|
|
||||||
"parserOptions": {
|
|
||||||
"ecmaVersion": 2018
|
|
||||||
},
|
|
||||||
"plugins": ["@typescript-eslint", "prettier", "simple-import-sort", "import"],
|
|
||||||
"extends": [
|
|
||||||
"eslint:recommended",
|
|
||||||
"plugin:@typescript-eslint/recommended",
|
|
||||||
"prettier/@typescript-eslint",
|
|
||||||
"plugin:prettier/recommended",
|
|
||||||
"plugin:import/typescript"
|
|
||||||
],
|
|
||||||
"rules": {
|
|
||||||
"curly": ["warn", "multi-line", "consistent"],
|
|
||||||
"no-console": ["warn", { "allow": ["error", "info", "warn"] }],
|
|
||||||
"no-param-reassign": "warn",
|
|
||||||
"no-shadow": "warn",
|
|
||||||
"prefer-const": "warn",
|
|
||||||
"spaced-comment": ["warn", "always", { "line": { "markers": ["/ <reference"] } }],
|
|
||||||
"import/no-cycle": "warn",
|
|
||||||
"simple-import-sort/sort": "warn",
|
|
||||||
"@typescript-eslint/explicit-function-return-type": ["warn", { "allowExpressions": true }],
|
|
||||||
"@typescript-eslint/no-empty-function": "off",
|
|
||||||
"@typescript-eslint/no-empty-interface": "off",
|
|
||||||
"@typescript-eslint/no-explicit-any": "off",
|
|
||||||
"@typescript-eslint/no-unused-vars": ["warn", { "argsIgnorePattern": "^_", "varsIgnorePattern": "^_" }],
|
|
||||||
"@typescript-eslint/no-use-before-define": "warn"
|
|
||||||
},
|
|
||||||
"overrides": [
|
|
||||||
{
|
|
||||||
"files": "**/*.js",
|
|
||||||
"rules": {
|
|
||||||
"@typescript-eslint/no-var-requires": "off"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"files": "**/*.spec.ts",
|
|
||||||
"rules": {
|
|
||||||
"@typescript-eslint/no-non-null-assertion": "off"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"files": "jasmine-testrunner.js",
|
|
||||||
"rules": {
|
|
||||||
"@typescript-eslint/camelcase": ["error", { "properties": "never" }]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user