cosmjs/.eslintrc.base.js

95 lines
3.3 KiB
JavaScript
Raw Permalink Normal View History

module.exports = {
env: {
es6: true,
jasmine: true,
node: true,
worker: true,
},
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaVersion: 2018,
2021-05-04 18:40:25 +02:00
project: "./tsconfig.eslint.json",
tsconfigRootDir: __dirname,
},
2020-08-04 09:39:05 +02:00
plugins: ["@typescript-eslint", "prettier", "simple-import-sort", "import"],
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
2021-05-04 18:40:25 +02:00
"prettier",
"plugin:prettier/recommended",
"plugin:import/typescript",
],
rules: {
curly: ["warn", "multi-line", "consistent"],
2020-02-19 09:42:20 +01:00
"no-bitwise": "warn",
"no-console": ["warn", { allow: ["error", "info", "table", "warn"] }],
"no-param-reassign": "warn",
2020-10-21 13:36:37 +02:00
"no-shadow": "off", // disabled in favour of @typescript-eslint/no-shadow, see https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-shadow.md
"no-unused-vars": "off", // disabled in favour of @typescript-eslint/no-unused-vars, see https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-unused-vars.md
"prefer-const": "warn",
radix: ["warn", "always"],
"spaced-comment": ["warn", "always", { line: { markers: ["/ <reference"] } }],
"import/no-cycle": "warn",
2021-05-04 18:40:25 +02:00
"simple-import-sort/imports": "warn",
2021-12-01 11:58:57 +01:00
"simple-import-sort/exports": "warn",
"@typescript-eslint/array-type": ["warn", { default: "array-simple" }],
2020-02-19 08:59:59 +01:00
"@typescript-eslint/await-thenable": "warn",
"@typescript-eslint/ban-types": "warn",
"@typescript-eslint/explicit-function-return-type": ["warn", { allowExpressions: true }],
"@typescript-eslint/explicit-member-accessibility": "warn",
"@typescript-eslint/naming-convention": [
"warn",
{
selector: "default",
format: ["strictCamelCase"],
},
{
selector: "typeLike",
format: ["StrictPascalCase"],
},
{
selector: "enumMember",
format: ["StrictPascalCase"],
},
{
selector: "variable",
format: ["strictCamelCase"],
leadingUnderscore: "allow",
},
{
selector: "parameter",
format: ["strictCamelCase"],
leadingUnderscore: "allow",
},
],
2020-02-19 09:03:17 +01:00
"@typescript-eslint/no-dynamic-delete": "warn",
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-empty-interface": "off",
"@typescript-eslint/no-explicit-any": "off",
2020-02-19 08:58:34 +01:00
"@typescript-eslint/no-floating-promises": "warn",
"@typescript-eslint/no-parameter-properties": "warn",
2020-10-21 13:36:37 +02:00
"@typescript-eslint/no-shadow": "warn",
"@typescript-eslint/no-unused-vars": ["warn", { argsIgnorePattern: "^_", varsIgnorePattern: "^_" }],
"@typescript-eslint/no-unnecessary-type-assertion": "warn",
"@typescript-eslint/no-use-before-define": "warn",
"@typescript-eslint/prefer-readonly": "warn",
},
overrides: [
{
files: "**/*.js",
rules: {
"@typescript-eslint/no-var-requires": "off",
2020-02-07 16:40:15 +01:00
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/explicit-member-accessibility": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
},
},
{
files: "**/*.spec.ts",
rules: {
"@typescript-eslint/no-non-null-assertion": "off",
},
},
],
};