From 204f3762eedd8028f7d79826dc625eb31bbcb909 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Fri, 28 Oct 2022 15:15:03 +0300 Subject: Merge `eslint` configuration from Next version --- vnext/.eslintrc | 76 ++++++++++++++++++++------------------------------------- 1 file changed, 27 insertions(+), 49 deletions(-) (limited to 'vnext/.eslintrc') diff --git a/vnext/.eslintrc b/vnext/.eslintrc index 34c2965d..639eb60a 100644 --- a/vnext/.eslintrc +++ b/vnext/.eslintrc @@ -1,15 +1,12 @@ { "extends": [ "eslint:recommended", + "plugin:jsdoc/recommended", "plugin:react/recommended", + "plugin:react/jsx-runtime", "plugin:jest/recommended" ], "parser": "@babel/eslint-parser", - "parserOptions": { - "sourceType": "module", - "allowImportExportEverywhere": false, - "codeFrame": false - }, "env": { "browser": true, "node": true, @@ -17,62 +14,43 @@ "jest/globals": true }, "plugins": [ - "babel", + "@babel", "react", - "jest", + "react-hooks", "only-ascii", - "react-hooks" + "testing-library", + "jest", + "jest-dom", + "jsdoc", + "no-floating-promise" ], "settings": { "react": { "pragma": "React", "version": "18" + }, + "jsdoc": { + "mode": "typescript" } }, + "overrides": [ + { + "files": ["**/__tests__/**/*.[jt]s?(x)", "**/?(*.)+(spec|test).[jt]s?(x)"], + "extends": ["plugin:testing-library/react"] + } + ], "rules": { - "strict": 0, - "no-console": "off", - "no-underscore-dangle": "warn", "quotes": ["error", "single"], - - "no-const-assign": "warn", - "no-this-before-super": "warn", - "no-unreachable": "warn", - "no-undef": "warn", - "constructor-super": "warn", - "valid-typeof": "warn", - "no-eq-null": "warn", - "no-shadow-restricted-names": "warn", - "no-trailing-spaces": "warn", - "semi": "warn", - "keyword-spacing": "warn", - "block-spacing": "warn", - "arrow-spacing": "warn", - "semi-spacing": "warn", - "brace-style": ["warn", "1tbs", { "allowSingleLine": true }], - "dot-location": ["warn", "property"], - "no-tabs": "warn", - "eol-last": "warn", - "comma-style": "warn", - "curly": "warn", - "no-shadow": "off", - "no-cond-assign": "off", - "no-sparse-arrays": "off", - "no-unused-vars": "off", - "no-useless-escape": "off", - "only-ascii/only-ascii": ["warn", { "allowedChars": "✓←→♡ ·—©" }], - - "jest/no-disabled-tests": "warn", - "jest/no-focused-tests": "error", - "jest/no-identical-title": "error", - "jest/prefer-to-have-length": "warn", - "jest/valid-expect": "error", - "react/prop-types": "off", - "react/jsx-uses-react": "off", - "react/react-in-jsx-scope": "off", - "react-hooks/rules-of-hooks": "error", - "react-hooks/exhaustive-deps": "warn" + "testing-library/no-node-access": "off", + "jsdoc/require-jsdoc": ["error", { "publicOnly" : true }], + "jsdoc/require-returns": "off", + "jsdoc/require-returns-type": "off", + "jsdoc/require-property-description": "off", + "jsdoc/require-param-description": "off", + "no-floating-promise/no-floating-promise": "error", + "semi": ["error", "always"], + "semi-style": ["error", "last"] } } -- cgit v1.2.3