From 445187349553b04ccab7162e6bfc4eda140e03be Mon Sep 17 00:00:00 2001 From: Aurino Geraldo Date: Thu, 1 Sep 2022 15:24:21 -0300 Subject: [PATCH] 5.1.0 Adicionando novas regras de lint (#20) * Change dependencies * Add new rule coma-dangle * Add new rules * Add new lint rules * Add new rule react-typescript * Fix rule ts * Update typescript.js Co-authored-by: Danilo Trevelin * Update react.js Co-authored-by: Danilo Trevelin * Update base.js Co-authored-by: Danilo Trevelin Co-authored-by: Danilo Trevelin --- base.js | 1 + package.json | 6 +++--- react-typescript.js | 37 ++++++++++++++++++++++++++++++++++--- react.js | 1 + typescript.js | 1 + 5 files changed, 40 insertions(+), 6 deletions(-) diff --git a/base.js b/base.js index 6f4e361..f561d5f 100644 --- a/base.js +++ b/base.js @@ -11,6 +11,7 @@ module.exports = { sourceType: 'module', }, rules: { + 'comma-dangle': off, strict: 0, 'no-underscore-dangle': [0, { 'allowAfterThis': true diff --git a/package.json b/package.json index 05906c0..00358c8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "eslint-config-getninjas", - "version": "5.0.0", + "version": "5.1.0", "description": "GetNinjas eslint config", "main": "index.js", "repository": { @@ -18,8 +18,8 @@ "url": "https://github.com/getninjas/eslint-config-getninjas/issues" }, "homepage": "https://github.com/getninjas/eslint-config-getninjas#readme", - "peerDependencies": { - "eslint": "8.0.1", + "dependencies": { + "eslint": "8.21.0", "eslint-plugin-react": "7.30.1", "eslint-config-prettier": "8.5.0", "eslint-plugin-prettier": "4.2.1", diff --git a/react-typescript.js b/react-typescript.js index e8739be..f75f25d 100644 --- a/react-typescript.js +++ b/react-typescript.js @@ -11,7 +11,9 @@ module.exports = { ], overrides: [ ], + parser: "@typescript-eslint/parser", parserOptions: { + project: "tsconfig.json", ecmaVersion: 'latest', sourceType: 'module' }, @@ -19,8 +21,37 @@ module.exports = { 'react' ], rules: { - "react/no-unescaped-entities": "off", "@next/next/no-page-custom-font": "off", - "import/no-anonymous-default-export": "off" - } + "import/no-anonymous-default-export": "off", + "comma-dangle": "off", + "prettier/prettier": "error", + "@typescript-eslint/dot-notation": "warn", + "@typescript-eslint/explicit-function-return-type": "off", + "@typescript-eslint/member-delimiter-style": "off", + "import/prefer-default-export": "off", + "import/extensions": "off", + "no-unused-vars": ["error", { "argsIgnorePattern": "^_" }], + "global-require": "off", + "no-param-reassign": "off", + "no-underscore-dangle": "off", + "camelcase": "off", + "no-console": ["error", { "allow": ["tron"] }], + "import/no-extraneous-dependencies": "off", + "no-use-before-define": "off", + "@typescript-eslint/no-use-before-define": ["error"], + "@typescript-eslint/explicit-module-boundary-types": "off", + "@typescript-eslint/indent": "off", + "@typescript-eslint/space-before-function-paren": "off", + "@typescript-eslint/semi": "off", + "@typescript-eslint/strict-boolean-expressions": "off", + "@typescript-eslint/restrict-template-expressions": "off", + "@typescript-eslint/prefer-nullish-coalescing": "off", + "import/no-duplicates": "off", + "multiline-ternary": "off" + }, + settings: { + react: { + version: 'detect', + }, + }, } diff --git a/react.js b/react.js index b061703..246efe9 100644 --- a/react.js +++ b/react.js @@ -28,5 +28,6 @@ module.exports = { 'react/jsx-no-bind': 'off', 'react/jsx-props-no-spreading': 'off', 'no-underscore-dangle': ['error', { allow: ['_links'] }], + 'comma-dangle': off, }, }; diff --git a/typescript.js b/typescript.js index 6075427..73dd43e 100644 --- a/typescript.js +++ b/typescript.js @@ -11,6 +11,7 @@ module.exports = { sourceType: 'module' }, rules: { + 'comma-dangle': off, 'prettier/prettier': ['error', {}, { usePrettierrc: true }], 'import/extensions': [ 'error',