Add eslint-plugin-import

This commit is contained in:
Aditya Thakral 2021-08-08 22:44:53 -04:00
parent 2031935ce4
commit 9b06c8aed3
3 changed files with 1196 additions and 6 deletions

View File

@ -9,6 +9,9 @@ module.exports = {
"eslint:recommended", "eslint:recommended",
"plugin:@typescript-eslint/recommended", "plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking", "plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:import/errors",
"plugin:import/warnings",
"plugin:import/typescript",
"plugin:react/recommended", "plugin:react/recommended",
"plugin:prettier/recommended", "plugin:prettier/recommended",
], ],
@ -16,12 +19,30 @@ module.exports = {
rules: { rules: {
"prettier/prettier": "error", "prettier/prettier": "error",
"import/first": "warn",
"import/order": [
"error",
{
"newlines-between": "always",
"alphabetize": {
"order": "asc",
"caseInsensitive": true,
},
"pathGroups": {
"pattern": "@/**",
"group": "external",
"position": "after",
}
},
],
"react/prop-types": "off", "react/prop-types": "off",
"react-hooks/rules-of-hooks": "error", "react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "error", "react-hooks/exhaustive-deps": "error",
// Turn off these rules // Turn off these rules
"@typescript-eslint/explicit-module-boundary-types": "off", "@typescript-eslint/explicit-module-boundary-types": "off",
"import/no-unresolved": "off",
}, },
settings: { settings: {
react: { react: {

1180
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -34,6 +34,7 @@
"@typescript-eslint/parser": "4.28.4", "@typescript-eslint/parser": "4.28.4",
"eslint": "7.32.0", "eslint": "7.32.0",
"eslint-config-prettier": "^8.3.0", "eslint-config-prettier": "^8.3.0",
"eslint-plugin-import": "^2.24.0",
"eslint-plugin-prettier": "^3.4.0", "eslint-plugin-prettier": "^3.4.0",
"eslint-plugin-react": "7.24.0", "eslint-plugin-react": "7.24.0",
"eslint-plugin-react-hooks": "^4.2.0", "eslint-plugin-react-hooks": "^4.2.0",