-
-
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
Open
oliviertassinari
wants to merge
4
commits into
mui:master
Choose a base branch
from
oliviertassinari:simplify-eslint
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
||||
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/**/*', | ||||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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