Skip to content

Commit

Permalink
[code-infra] Rule already in code-infra
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari committed Apr 21, 2024
1 parent 906ad7d commit 94a2fe8
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const baseline = require('@mui/monorepo/.eslintrc');
const path = require('path');

// TODO move this helper to @mui/monorepo/.eslintrc
const buildPackageRestrictedImports = (packageName, root) => ({
files: [`packages/${root}/src/**/*{.ts,.tsx,.js}`],
excludedFiles: ['*.d.ts', '*.spec.ts', '*.spec.tsx', '**.test.tx', '**.test.tsx'],
Expand Down Expand Up @@ -50,10 +51,12 @@ module.exports = {
*/
rules: {
...baseline.rules,
// TODO move to @mui/monorepo/.eslintrc, codebase is moving away from default exports
'import/prefer-default-export': 'off',
// TODO move rule into the main repo once it has upgraded
'@typescript-eslint/return-await': 'off',
'no-restricted-imports': 'off',
// TODO move to @mui/monorepo/.eslintrc
'jsdoc/require-param': ['error', { contexts: ['TSFunctionType'] }],
'jsdoc/require-param-type': ['error', { contexts: ['TSFunctionType'] }],
'jsdoc/require-param-name': ['error', { contexts: ['TSFunctionType'] }],
Expand All @@ -75,7 +78,10 @@ module.exports = {
],
// Fixes false positive when using both `inputProps` and `InputProps` on the same example
// See https://stackoverflow.com/questions/42367236/why-am-i-getting-this-warning-no-duplicate-props-allowed-react-jsx-no-duplicate
// TODO move to @mui/monorepo/.eslintrc
// TODO Fix <Input> props names to not conflict
'react/jsx-no-duplicate-props': [1, { ignoreCase: false }],
// TOOD move to @mui/monorepo/.eslintrc, these are false positive
'react/no-unstable-nested-components': ['error', { allowAsProps: true }],
},
overrides: [
Expand Down Expand Up @@ -114,19 +120,15 @@ module.exports = {
},
parserOptions: { tsconfigRootDir: __dirname, project: ['./tsconfig.json'] },
},
// TODO remove, shouldn't disable prop-type generation rule.
// lot of public components are missing it.
{
files: ['*.tsx'],
excludedFiles: '*.spec.tsx',
rules: {
'react/prop-types': 'off',
},
},
{
files: ['docs/data/**/*.js', 'docs/data/**/*.tsx'],
rules: {
'filenames/match-exported': ['error'],
},
},
{
files: ['**/*.mjs'],
rules: {
Expand Down

0 comments on commit 94a2fe8

Please sign in to comment.