-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Add an ESLint rule to prevent the usage of useRef other than for HTML elements. #2014
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,7 +16,8 @@ module.exports = { | |
| 'plugin:@typescript-eslint/recommended', | ||
| 'plugin:prettier/recommended', | ||
| 'plugin:storybook/recommended', | ||
| 'react-app', | ||
| 'plugin:react/recommended', | ||
| 'plugin:react-hooks/recommended', | ||
| ], | ||
| root: true, | ||
| env: { | ||
|
|
@@ -33,6 +34,12 @@ module.exports = { | |
| { | ||
| files: ['*.js', '*.jsx', '*.ts', '*.tsx'], | ||
| rules: { | ||
| 'react/no-unescaped-entities': 'off', | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. disabling these as the new plugin is stricter. I think it would be great to reactivate jsx-key one, others do not seem that useful (I'm not sure about prop-types)
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Alright |
||
| 'react/prop-types': 'off', | ||
| 'react/jsx-key': 'off', | ||
| 'react/display-name': 'off', | ||
| 'react/jsx-uses-react': 'off', | ||
| 'react/react-in-jsx-scope': 'off', | ||
| 'no-control-regex': 0, | ||
| 'simple-import-sort/imports': [ | ||
| 'error', | ||
|
|
@@ -72,6 +79,7 @@ module.exports = { | |
| 'twenty/component-props-naming': 'error', | ||
| 'twenty/sort-css-properties-alphabetically': 'error', | ||
| 'twenty/styled-components-prefixed-with-styled': 'error', | ||
| 'twenty/no-state-useref': 'error', | ||
| 'func-style':['error', 'declaration', { 'allowArrowFunctions': true }], | ||
| "@typescript-eslint/no-unused-vars": "off", | ||
| "no-unused-vars": "off", | ||
|
|
@@ -108,5 +116,10 @@ module.exports = { | |
| ], | ||
| "@typescript-eslint/consistent-type-imports": ["error", { "prefer": "no-type-imports" }], | ||
| 'no-console': ['error', { allow: ['group', 'groupCollapsed', 'groupEnd'] }], | ||
| }, | ||
| settings: { | ||
| "react": { | ||
| "version": "detect" | ||
| } | ||
| } | ||
| }; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -87,22 +87,6 @@ | |
| "chromatic": "dotenv cross-var npx chromatic --project-token=$CHROMATIC_PROJECT_TOKEN", | ||
| "install": "yarn eslint-plugin:setup" | ||
| }, | ||
| "eslintConfig": { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. removing this section as we use .eslintrc |
||
| "extends": [ | ||
| "react-app", | ||
| "react-app/jest" | ||
| ], | ||
| "overrides": [ | ||
| { | ||
| "files": [ | ||
| "**/*.stories.*" | ||
| ], | ||
| "rules": { | ||
| "import/no-anonymous-default-export": "off" | ||
| } | ||
| } | ||
| ] | ||
| }, | ||
| "overrides": { | ||
| "react-refresh": "0.14.0" | ||
| }, | ||
|
|
@@ -157,7 +141,8 @@ | |
| "@types/react-datepicker": "^4.11.2", | ||
| "@types/scroll-into-view": "^1.16.0", | ||
| "@types/uuid": "^9.0.1", | ||
| "@typescript-eslint/eslint-plugin": "^5.45.0", | ||
| "@typescript-eslint/eslint-plugin": "^6.7.5", | ||
| "@typescript-eslint/parser": "^6.7.5", | ||
| "@typescript-eslint/utils": "^6.7.0", | ||
| "babel-plugin-named-exports-order": "^0.0.2", | ||
| "chromatic": "^6.18.0", | ||
|
|
@@ -166,7 +151,6 @@ | |
| "dotenv-cli": "^7.2.1", | ||
| "eslint": "^8.28.0", | ||
| "eslint-config-prettier": "^8.5.0", | ||
| "eslint-config-react-app": "^7.0.1", | ||
| "eslint-config-standard-with-typescript": "^23.0.0", | ||
| "eslint-plugin-import": "^2.26.0", | ||
| "eslint-plugin-n": "^15.5.1", | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm moving to these plugins as the react-app config is not compatible with the newer eslint version
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright