Skip to content

Commit

Permalink
enforce-path-imports-for-mui-icons
Browse files Browse the repository at this point in the history
  • Loading branch information
Darshan808 committed Feb 7, 2025
1 parent 9874653 commit 8b16e0b
Show file tree
Hide file tree
Showing 5 changed files with 345 additions and 187 deletions.
10 changes: 10 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
node_modules
dist
coverage
**/*.d.ts
tests

**/__tests__
ui-tests

.*.js
58 changes: 58 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
module.exports = {
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended'
],
parser: '@typescript-eslint/parser',
parserOptions: {
tsconfigRootDir: __dirname,
project: './tsconfig.json'
},
plugins: ['@stylistic', '@typescript-eslint'],
rules: {
'@typescript-eslint/naming-convention': [
'error',
{
selector: 'interface',
format: ['PascalCase'],
custom: {
regex: '^I[A-Z]',
match: true
}
}
],
'@typescript-eslint/no-unused-vars': ['warn', { args: 'none' }],
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-namespace': 'off',
'@typescript-eslint/no-use-before-define': 'off',
'@stylistic/quotes': [
'error',
'single',
{ avoidEscape: true, allowTemplateLiterals: false }
],
curly: ['error', 'all'],
eqeqeq: 'error',
'no-restricted-imports': [
'error',
{
paths: [
{
name: '@mui/icons-material',

message:
"Please import icons using path imports, e.g. import AddIcon from '@mui/icons-material/Add'"
}
],
patterns: [
{
group: ['@mui/*/*/*'],
message: '3rd level imports in mui are considered private'
}
]
}
],
'prefer-arrow-callback': 'error'
}
};
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@
"@babel/preset-env": "^7.0.0",
"@jupyterlab/builder": "^4.0.0",
"@jupyterlab/testutils": "^4.0.0",
"@stylistic/eslint-plugin": "^3.0.1",
"@testing-library/jest-dom": "^6.1.4",
"@testing-library/react": "^14.0.0",
"@testing-library/user-event": "^14.5.1",
Expand All @@ -114,11 +115,11 @@
"@types/react-virtualized-auto-sizer": "^1.0.0",
"@types/react-window": "^1.8.2",
"@types/resize-observer-browser": "^0.1.7",
"@typescript-eslint/eslint-plugin": "^6.1.0",
"@typescript-eslint/parser": "^6.1.0",
"@typescript-eslint/eslint-plugin": "^8.0.0",
"@typescript-eslint/parser": "^8.0.0",
"all-contributors-cli": "^6.14.0",
"css-loader": "^6.7.1",
"eslint": "^8.36.0",
"eslint": "^8.56.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-prettier": "^5.0.0",
"eslint-plugin-react": "^7.33.0",
Expand Down
1 change: 1 addition & 0 deletions src/components/SubmoduleMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export interface ISubmoduleMenuProps {
/**
* Interface describing component state.
*/
// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface ISubmoduleMenuState {}

/**
Expand Down
Loading

0 comments on commit 8b16e0b

Please sign in to comment.