Skip to content

Commit

Permalink
update deps & disable some rules
Browse files Browse the repository at this point in the history
  • Loading branch information
jonataswalker committed Apr 6, 2022
1 parent d445646 commit 84073c0
Show file tree
Hide file tree
Showing 9 changed files with 330 additions and 307 deletions.
10 changes: 5 additions & 5 deletions node.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
module.exports = {
extends: ['plugin:node/recommended'],
rules: {
'node/exports-style': ['error', 'module.exports'],
'node/file-extension-in-import': ['error', 'always'],
'node/prefer-promises/fs': 'error',
'node/prefer-promises/dns': 'error',
'node/prefer-global/url': ['error', 'always'],
'node/prefer-global/buffer': ['error', 'always'],
'node/prefer-global/console': ['error', 'always'],
'node/prefer-global/process': ['error', 'always'],
'node/file-extension-in-import': ['error', 'always'],
'node/prefer-global/url-search-params': ['error', 'always'],
'node/prefer-global/url': ['error', 'always'],
'node/prefer-promises/dns': 'error',
'node/prefer-promises/fs': 'error',
'node/exports-style': ['error', 'module.exports'],
},
overrides: [
{
Expand Down
497 changes: 254 additions & 243 deletions package-lock.json

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eslint-config-jwalker",
"version": "7.3.0",
"version": "7.4.0",
"description": "Shareable framework-agnostic ESLint config",
"author": "Jonatas Walker",
"homepage": "https://github.com/jonataswalker/eslint-config-jwalker",
Expand All @@ -22,31 +22,31 @@
"prepare": "husky install"
},
"dependencies": {
"@typescript-eslint/eslint-plugin": "^5.14.0",
"@typescript-eslint/parser": "^5.14.0",
"@typescript-eslint/eslint-plugin": "^5.18.0",
"@typescript-eslint/parser": "^5.18.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-airbnb-typescript": "^16.1.0",
"eslint-config-airbnb-typescript": "^17.0.0",
"eslint-config-prettier": "^8.5.0",
"eslint-import-resolver-alias": "^1.1.2",
"eslint-import-resolver-typescript": "^2.5.0",
"eslint-import-resolver-typescript": "^2.7.1",
"eslint-plugin-array-func": "^3.1.7",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-import": "^2.25.4",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-no-unsanitized": "^4.0.1",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^6.0.0",
"eslint-plugin-security": "^1.4.0",
"eslint-plugin-sonarjs": "^0.12.0",
"eslint-plugin-unicorn": "^41.0.0"
"eslint-plugin-sonarjs": "^0.13.0",
"eslint-plugin-unicorn": "^42.0.0"
},
"peerDependencies": {
"eslint": ">= 8",
"prettier": ">= 2"
},
"devDependencies": {
"eslint": "^8.10.0",
"eslint": "^8.12.0",
"eslint-plugin-prettier": "^4.0.0",
"husky": "^7.0.4",
"prettier": "^2.5.1"
"prettier": "^2.6.2"
}
}
30 changes: 15 additions & 15 deletions rules/best-practices.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
module.exports = {
'accessor-pairs': 'error',
complexity: [1, 20],
'grouped-accessor-pairs': 'error',
'no-constructor-return': 'error',
'no-labels': 'error',
'no-eq-null': 'error',
'no-div-regex': 'error',
'require-await': 'error',
'accessor-pairs': 'error',
'no-useless-call': 'error',
'no-setter-return': 'error',
'no-empty-function': 'error',
'no-eq-null': 'error',
'no-implicit-coercion': 'error',
'no-implicit-globals': 'error',
'no-labels': 'error',
'no-param-reassign': 'error',
'no-promise-executor-return': 'error',
'no-unmodified-loop-condition': 'error',
'no-unused-expressions': 'error',
'no-useless-call': 'error',
'no-implicit-globals': 'error',
'no-unreachable-loop': 'error',
'no-warning-comments': 'warn',
'require-await': 'error',
'no-implicit-coercion': 'error',
'no-constructor-return': 'error',
'no-unused-expressions': 'error',
'no-constant-condition': 'error',
'no-setter-return': 'error',
'grouped-accessor-pairs': 'error',
'require-atomic-updates': 'error',
'no-promise-executor-return': 'error',
'no-unmodified-loop-condition': 'error',
'no-warning-comments': 'warn',
complexity: [1, 20],
};
21 changes: 11 additions & 10 deletions rules/general.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,26 @@ const cjsExport = 'cjs-export';
const cjsImport = 'cjs-import';

module.exports = {
'max-classes-per-file': 'error',
'no-duplicate-imports': 'error',
'func-names': 'off',
'no-process-exit': 'off',
'no-underscore-dangle': 'off',
'max-lines-per-function': 'off',
'new-cap': 'error',
'sort-vars': 'error',
'prefer-const': 'error',
'no-undefined': 'error',
'func-names': 'off',
'no-inline-comments': 'error',
'max-classes-per-file': 'error',
'no-negated-condition': 'error',
'no-duplicate-imports': 'error',
'prefer-exponentiation-operator': 'error',
'line-comment-position': ['error', { position: 'above' }],
'max-depth': ['error', 4],
'max-len': ['error', { code: 120, ignoreUrls: true }],
'max-lines-per-function': 'error',
'max-nested-callbacks': ['error', 4],
'max-params': ['error', 3],
'max-statements': ['error', 25],
'max-statements-per-line': ['error', { max: 1 }],
'new-cap': 'error',
'no-inline-comments': 'error',
'no-negated-condition': 'error',
'no-underscore-dangle': 'off',
'object-curly-newline': ['error', { consistent: true }],
'object-curly-spacing': ['error', 'always'],
'padding-line-between-statements': [
Expand All @@ -40,8 +43,6 @@ module.exports = {
{ blankLine: 'any', prev: cjsImport, next: '*' },
{ blankLine: 'any', prev: cjsImport, next: cjsImport },
],
'prefer-exponentiation-operator': 'error',
'sort-vars': 'error',
'no-restricted-syntax': [
'error',
{
Expand Down
4 changes: 2 additions & 2 deletions rules/import.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ module.exports = {
'import/group-exports': 'off',
'import/no-absolute-path': 'off',
'import/max-dependencies': 'off',
'import/no-unused-modules': 'off',
'import/prefer-default-export': 'off',
'import/no-anonymous-default-export': 'off',
'import/named': 'error',
Expand All @@ -17,7 +18,7 @@ module.exports = {
'import/no-named-as-default': 'error',
'import/no-useless-path-segments': 'error',
'import/no-named-as-default-member': 'error',
'import/no-unused-modules': ['error', { missingExports: false, unusedExports: true }],
'import/no-extraneous-dependencies': ['error', { devDependencies: true }],
'import/extensions': [
'error',
'always',
Expand All @@ -29,7 +30,6 @@ module.exports = {
},
},
],
'import/no-extraneous-dependencies': ['error', { devDependencies: true }],
'import/order': [
'error',
{
Expand Down
7 changes: 5 additions & 2 deletions rules/unicorn.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
module.exports = {
'unicorn/no-null': 'off',
'unicorn/no-array-for-each': 'off',
'unicorn/import-style': 'off',
'unicorn/prefer-module': 'off',
'unicorn/no-empty-file': 'off',
'unicorn/prefer-spread': 'off',
'unicorn/no-process-exit': 'off',
'unicorn/no-array-for-each': 'off',
'unicorn/prefer-node-protocol': 'off',
'unicorn/no-unused-properties': 'off',
'unicorn/import-style': 'off',
'unicorn/filename-case': ['error', { cases: { kebabCase: true, camelCase: true, pascalCase: true } }],
'unicorn/prevent-abbreviations': [
'error',
Expand Down
38 changes: 23 additions & 15 deletions ts-for-js.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,31 @@ module.exports = {
plugins: ['@typescript-eslint'],
rules: {
'require-await': 'off',
'@typescript-eslint/require-await': 'error',
'no-return-await': 'off',
'@typescript-eslint/return-await': ['error', 'always'],
'no-void': ['error', { allowAsStatement: true }],
'@typescript-eslint/no-floating-promises': 'error',
'@typescript-eslint/no-this-alias': 'error',
'@typescript-eslint/prefer-for-of': 'error',
'@typescript-eslint/require-await': 'error',
'@typescript-eslint/await-thenable': 'error',
'@typescript-eslint/ban-ts-comment': 'error',
'@typescript-eslint/ban-tslint-comment': 'error',
'@typescript-eslint/no-base-to-string': 'error',
'@typescript-eslint/no-dynamic-delete': 'error',
'@typescript-eslint/no-extraneous-class': 'error',
'@typescript-eslint/no-misused-new': 'error',
'@typescript-eslint/unbound-method': 'error',
'@typescript-eslint/no-for-in-array': 'error',
'@typescript-eslint/prefer-includes': 'error',
'@typescript-eslint/no-implied-eval': 'error',
'@typescript-eslint/no-misused-new': 'error',
'@typescript-eslint/no-misused-promises': 'error',
'@typescript-eslint/no-this-alias': 'error',
'@typescript-eslint/no-throw-literal': 'error',
'@typescript-eslint/prefer-for-of': 'error',
'@typescript-eslint/prefer-includes': 'error',
'@typescript-eslint/no-base-to-string': 'error',
'@typescript-eslint/no-dynamic-delete': 'error',
'@typescript-eslint/ban-tslint-comment': 'error',
'@typescript-eslint/no-misused-promises': 'error',
'@typescript-eslint/no-extraneous-class': 'error',
'@typescript-eslint/no-floating-promises': 'error',
'@typescript-eslint/prefer-optional-chain': 'error',
'@typescript-eslint/prefer-string-starts-ends-with': 'error',
'@typescript-eslint/promise-function-async': 'error',
'@typescript-eslint/require-array-sort-compare': 'error',
'@typescript-eslint/unbound-method': 'error',
'@typescript-eslint/no-confusing-void-expression': 'error',
'@typescript-eslint/prefer-string-starts-ends-with': 'error',
'@typescript-eslint/return-await': ['error', 'always'],
'no-void': ['error', { allowAsStatement: true }],

'@typescript-eslint/no-unnecessary-boolean-literal-compare': [
'error',
Expand Down Expand Up @@ -64,6 +64,14 @@ module.exports = {
format: ['PascalCase'],
prefix: ['is', 'has', 'are', 'can', 'should', 'did', 'will'],
},
{
selector: 'property',
format: null,
filter: {
regex: '^(logger|exposeHeadRoutes|useUnifiedTopology|prettyPrint|success)$',
match: true,
},
},
],
},
};
10 changes: 5 additions & 5 deletions ts.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ module.exports = {
],
plugins: ['import'],
rules: {
'@typescript-eslint/no-type-alias': 'off',
'@typescript-eslint/member-ordering': 'off',
'@typescript-eslint/no-restricted-imports': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-magic-numbers': [
'error',
{
Expand Down Expand Up @@ -37,11 +42,6 @@ module.exports = {
allow: ['defaultStatus', 'event', 'find', 'length', 'name', 'status'],
},
],
'@typescript-eslint/member-ordering': 'off',
'@typescript-eslint/no-type-alias': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-restricted-imports': 'off',
'@typescript-eslint/prefer-readonly-parameter-types': ['error', { ignoreInferredTypes: true }],
'@typescript-eslint/no-use-before-define': ['error', { ignoreTypeReferences: false }],
'@typescript-eslint/restrict-plus-operands': ['error', { checkCompoundAssignments: true }],
Expand Down

0 comments on commit 84073c0

Please sign in to comment.