Skip to content

Commit

Permalink
feat: add no-restricted-imports rule for relative imports
Browse files Browse the repository at this point in the history
Add an error rule for importing using relative imports (starting with './') as they are hard to read, scale and maintain
  • Loading branch information
Willem-Jaap committed Oct 2, 2023
1 parent f289600 commit 17e52ae
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// @eslint-ignore
module.exports = {
parserOptions: { project: './tsconfig.json' },
parser: '@typescript-eslint/parser',
Expand Down Expand Up @@ -54,5 +53,17 @@ module.exports = {
},
],
'react/react-in-jsx-scope': 'off',
'no-restricted-imports': [
'error',
{
patterns: [
{
group: ['./*'],
message:
'Please use absolute imports instead. Take a look at the paths in tsconfig.json for available options.',
},
],
},
],
},
};

0 comments on commit 17e52ae

Please sign in to comment.