Skip to content

Commit

Permalink
Merge pull request #17 from LexBorisoff/dev
Browse files Browse the repository at this point in the history
Improve import rules
  • Loading branch information
LexBorisoff authored Jan 5, 2025
2 parents 22f3904 + 6ea9fa3 commit 62d60e0
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 3 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,14 @@ _**Import Rules**_
'object',
'type',
],
'newlines-between': 'always-and-inside-groups',
'newlines-between': 'always',
alphabetize: {
order: 'asc',
caseInsensitive: true,
},
},
],
'unused-imports/no-unused-imports': 'error',
}
```

Expand Down
7 changes: 6 additions & 1 deletion eslint/plugin/configs/import.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import importPlugin from 'eslint-plugin-import';
import unusedImports from 'eslint-plugin-unused-imports';
import tseslint from 'typescript-eslint';
export default tseslint.config(importPlugin.flatConfigs.recommended, {
plugins: {
'unused-imports': unusedImports,
},
rules: {
'import/no-cycle': 'error',
'import/no-duplicates': 'error',
Expand All @@ -26,12 +30,13 @@ export default tseslint.config(importPlugin.flatConfigs.recommended, {
'object',
'type',
],
'newlines-between': 'always-and-inside-groups',
'newlines-between': 'always',
alphabetize: {
order: 'asc',
caseInsensitive: true,
},
},
],
'unused-imports/no-unused-imports': 'error',
},
});
14 changes: 14 additions & 0 deletions license
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
ISC License

Copyright (c) 2025 Lex Borisoff

Permission to use, copy, modify, and/or distribute this software for any purpose
with or without fee is hereby granted, provided that the above copyright notice
and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED “AS IS” AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD
TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA
OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 changes: 17 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
"@types/node": "^20.17.9",
"conventional-changelog-conventionalcommits": "^8.0.0",
"eslint": "^9.15.0",
"eslint-plugin-unused-imports": "^4.1.4",
"husky": "^9.1.7",
"prettier": "^3.3.3",
"rimraf": "^6.0.1",
Expand Down
7 changes: 6 additions & 1 deletion src/plugin/configs/import.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import importPlugin from 'eslint-plugin-import';
import unusedImports from 'eslint-plugin-unused-imports';
import tseslint from 'typescript-eslint';

export default tseslint.config(importPlugin.flatConfigs.recommended, {
plugins: {
'unused-imports': unusedImports,
},
rules: {
'import/no-cycle': 'error',
'import/no-duplicates': 'error',
Expand All @@ -27,12 +31,13 @@ export default tseslint.config(importPlugin.flatConfigs.recommended, {
'object',
'type',
],
'newlines-between': 'always-and-inside-groups',
'newlines-between': 'always',
alphabetize: {
order: 'asc',
caseInsensitive: true,
},
},
],
'unused-imports/no-unused-imports': 'error',
},
});

0 comments on commit 62d60e0

Please sign in to comment.