-
-
Notifications
You must be signed in to change notification settings - Fork 313
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
[core] Remove duplicate eslint rule #4559
base: master
Are you sure you want to change the base?
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 | ||
---|---|---|---|---|
|
@@ -56,29 +56,22 @@ module.exports = { | |||
*/ | ||||
rules: { | ||||
...baseline.rules, | ||||
// TODO move to @mui/monorepo, codebase is moving away from default exports https://github.com/mui/material-ui/issues/21862 | ||||
/* TODO, trying to move to @mui/monorepo */ | ||||
// codebase is moving away from default exports https://github.com/mui/material-ui/issues/21862 | ||||
'import/prefer-default-export': 'off', | ||||
// TODO move rule into the main repo once it has upgraded | ||||
'@typescript-eslint/return-await': 'off', | ||||
'no-restricted-imports': ['error', noRestrictedImports], | ||||
'react-compiler/react-compiler': 'error', | ||||
// Turning react/jsx-key back on. | ||||
// https://github.com/airbnb/javascript/blob/5155aa5fc1ea9bb2c6493a06ddbd5c7a05414c86/packages/eslint-config-airbnb/rules/react.js#L94 | ||||
'react/jsx-key': ['error', { checkKeyMustBeforeSpread: true, warnOnDuplicates: true }], | ||||
|
||||
/* Toolpad specfic */ | ||||
'no-restricted-syntax': [ | ||||
...baseline.rules['no-restricted-syntax'].filter((rule) => { | ||||
// Too opinionated for Toolpad | ||||
return rule?.selector !== 'ForOfStatement'; | ||||
}), | ||||
], | ||||
// Turning react/jsx-key back on. | ||||
// https://github.com/airbnb/javascript/blob/5155aa5fc1ea9bb2c6493a06ddbd5c7a05414c86/packages/eslint-config-airbnb/rules/react.js#L94 | ||||
'react/jsx-key': ['error', { checkKeyMustBeforeSpread: true, warnOnDuplicates: true }], | ||||
// This got turned of in the mono-repo: | ||||
// See https://github.com/mui/toolpad/pull/866#discussion_r957222171 | ||||
'react/no-unused-prop-types': [ | ||||
'error', | ||||
{ | ||||
customValidators: [], | ||||
skipShapeProps: true, | ||||
}, | ||||
], | ||||
'no-restricted-imports': ['error', noRestrictedImports], | ||||
'import/no-unresolved': [ | ||||
'error', | ||||
{ | ||||
|
@@ -100,37 +93,13 @@ module.exports = { | |||
}, | ||||
], | ||||
'material-ui/no-hardcoded-labels': 'off', // We are not really translating the docs/website anymore | ||||
'react-compiler/react-compiler': 'error', | ||||
}, | ||||
overrides: [ | ||||
...baseline.overrides, | ||||
{ | ||||
files: ['**/*.test.js', '**/*.test.ts', '**/*.test.tsx'], | ||||
extends: ['plugin:testing-library/react'], | ||||
}, | ||||
{ | ||||
files: ['docs/src/modules/components/**/*.js'], | ||||
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. Removed, duplicate with Line 102 in 4fa09eb
|
||||
rules: { | ||||
'material-ui/no-hardcoded-labels': 'off', | ||||
}, | ||||
}, | ||||
{ | ||||
/** | ||||
* TODO move to @mui/monorepo | ||||
* | ||||
* Examples are for demostration purposes and should not be considered as part of the library. | ||||
* They don't contain an eslint setup, so we don't want them to contain eslint directives | ||||
* We do however want to keep the rules in place to ensure the examples are following | ||||
* a reasonably similar code style as the library. | ||||
*/ | ||||
files: ['examples/**/*'], | ||||
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. Removed, duplicates with https://github.com/mui/material-ui/blob/060c55cb219bfc33633f7e61484884ea6d37bfdf/.eslintrc.js#L529 |
||||
rules: { | ||||
'no-console': 'off', | ||||
'no-underscore-dangle': 'off', | ||||
// no node_modules in examples as they are not installed | ||||
'import/no-unresolved': 'off', | ||||
}, | ||||
}, | ||||
{ | ||||
files: [ | ||||
'packages/create-toolpad-app/**/*', | ||||
|
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.
Removed, duplicate with https://github.com/mui/material-ui/blob/060c55cb219bfc33633f7e61484884ea6d37bfdf/.eslintrc.js#L144-L145