Skip to content

Commit

Permalink
eslint rules refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Грозных Артем Сергеевич committed Mar 28, 2022
1 parent bd1a2c9 commit ca8a6d2
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 54 deletions.
3 changes: 0 additions & 3 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,4 @@ module.exports = {
parserOptions: {
project: 'tsconfig.json',
},
rules: {
curly: 'error',
},
};
100 changes: 49 additions & 51 deletions packages/eslint-config/lib/eslint-config.js
Original file line number Diff line number Diff line change
@@ -1,49 +1,47 @@
"use strict";
'use strict';

module.exports = {
root: true,
ignorePatterns: ["dist/", "*.js"],
parser: "@typescript-eslint/parser",
plugins: ["simple-import-sort", "import", "unused-imports"],
ignorePatterns: ['dist/', '*.js'],
parser: '@typescript-eslint/parser',
plugins: ['simple-import-sort', 'import', 'unused-imports'],
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:prettier/recommended",
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'plugin:prettier/recommended',
],
env: {
node: true,
},
rules: {
eqeqeq: "error",
"@typescript-eslint/explicit-member-accessibility": [
"error",
{ accessibility: "no-public" },
],
"import/order": "off",
"simple-import-sort/exports": "warn",
"import/first": "warn",
"import/newline-after-import": "warn",
"import/no-duplicates": "warn",
"unused-imports/no-unused-imports": "warn",
"@typescript-eslint/consistent-type-imports": "error",
"@typescript-eslint/no-unused-vars": [
"warn",
curly: 'error',
eqeqeq: 'error',
'@typescript-eslint/explicit-member-accessibility': ['error', { accessibility: 'no-public' }],
'import/order': 'off',
'simple-import-sort/exports': 'warn',
'import/first': 'warn',
'import/newline-after-import': 'warn',
'import/no-duplicates': 'warn',
'unused-imports/no-unused-imports': 'warn',
'@typescript-eslint/consistent-type-imports': 'error',
'@typescript-eslint/no-unused-vars': [
'warn',
{
vars: "all",
varsIgnorePattern: "^_",
args: "after-used",
argsIgnorePattern: "^_",
vars: 'all',
varsIgnorePattern: '^_',
args: 'after-used',
argsIgnorePattern: '^_',
},
],
// Enforce that private members are prefixed with an underscore
"@typescript-eslint/naming-convention": [
"error",
'@typescript-eslint/naming-convention': [
'error',
{
selector: "memberLike",
modifiers: ["private"],
format: ["camelCase"],
leadingUnderscore: "require",
selector: 'memberLike',
modifiers: ['private'],
format: ['camelCase'],
leadingUnderscore: 'require',
},
],

Expand All @@ -62,24 +60,24 @@ module.exports = {
},
],

"@typescript-eslint/ban-ts-comment": "warn",
"@typescript-eslint/no-unsafe-argument": "warn",
"@typescript-eslint/no-unsafe-assignment": "warn",
"@typescript-eslint/no-unsafe-member-access": "warn",
"@typescript-eslint/no-unsafe-call": "warn",
"@typescript-eslint/no-unsafe-return": "warn",
"@typescript-eslint/no-misused-promises": "warn",
"@typescript-eslint/restrict-template-expressions": "warn",
"@typescript-eslint/unbound-method": "warn",
"no-async-promise-executor": "warn",
"@typescript-eslint/no-floating-promises": "warn",
"@typescript-eslint/restrict-plus-operands": "warn",
"@typescript-eslint/ban-types": "warn",
"@typescript-eslint/require-await": "warn",
"no-prototype-builtins": "warn",
"no-constant-condition": "warn",
"@typescript-eslint/no-empty-interface": "warn",
"@typescript-eslint/no-empty-function": "warn",
"@typescript-eslint/no-var-requires": "warn",
'@typescript-eslint/ban-ts-comment': 'warn',
'@typescript-eslint/no-unsafe-argument': 'warn',
'@typescript-eslint/no-unsafe-assignment': 'warn',
'@typescript-eslint/no-unsafe-member-access': 'warn',
'@typescript-eslint/no-unsafe-call': 'warn',
'@typescript-eslint/no-unsafe-return': 'warn',
'@typescript-eslint/no-misused-promises': 'warn',
'@typescript-eslint/restrict-template-expressions': 'warn',
'@typescript-eslint/unbound-method': 'warn',
'no-async-promise-executor': 'warn',
'@typescript-eslint/no-floating-promises': 'warn',
'@typescript-eslint/restrict-plus-operands': 'warn',
'@typescript-eslint/ban-types': 'warn',
'@typescript-eslint/require-await': 'warn',
'no-prototype-builtins': 'warn',
'no-constant-condition': 'warn',
'@typescript-eslint/no-empty-interface': 'warn',
'@typescript-eslint/no-empty-function': 'warn',
'@typescript-eslint/no-var-requires': 'warn',
},
};

0 comments on commit ca8a6d2

Please sign in to comment.