Skip to content

Commit 3d2edac

Browse files
committed
Add eslint-plugin-unicorn
1 parent b5e053e commit 3d2edac

11 files changed

Lines changed: 217 additions & 100 deletions

File tree

.eslintrc.yaml

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
extends:
22
- eslint:recommended
3-
- plugin:eslint-comments/recommended
4-
- plugin:import/recommended
5-
- plugin:import/typescript
63
- plugin:@typescript-eslint/recommended
74
- plugin:@typescript-eslint/recommended-requiring-type-checking
85
- plugin:@typescript-eslint/strict
6+
- plugin:eslint-comments/recommended
7+
- plugin:import/recommended
8+
- plugin:import/typescript
99
- plugin:jsdoc/recommended
10+
- plugin:unicorn/recommended
1011
- prettier
1112
parser: '@typescript-eslint/parser'
1213
parserOptions:
@@ -15,8 +16,8 @@ parserOptions:
1516
allowAutomaticSingleRunInference: true
1617
plugins:
1718
- '@typescript-eslint'
18-
- filenames
1919
- jsdoc
20+
- unicorn
2021
settings:
2122
import/resolver:
2223
typescript:
@@ -66,9 +67,6 @@ rules:
6667
'@typescript-eslint/switch-exhaustiveness-check': error
6768
'@typescript-eslint/unified-signatures': error
6869
'eslint-comments/no-unused-disable': 'error'
69-
'filenames/match-regex':
70-
- 'error'
71-
- '^[a-z0-9-.]+$' # Kebab-case.
7270
jsdoc/check-param-names: off
7371
jsdoc/newline-after-description: off
7472
jsdoc/require-jsdoc:
@@ -79,6 +77,23 @@ rules:
7977
jsdoc/require-param: off
8078
jsdoc/require-param-type: off
8179
jsdoc/tag-lines: off
80+
unicorn/consistent-function-scoping:
81+
- 'error'
82+
- checkArrowFunctions: false
83+
unicorn/custom-error-definition: error
84+
unicorn/no-array-callback-reference: off
85+
unicorn/no-null: off
86+
unicorn/prefer-module: off
87+
unicorn/prefer-ternary:
88+
- error
89+
- only-single-line
90+
unicorn/prevent-abbreviations:
91+
- error
92+
- allowList:
93+
'args': true
94+
'doc': true
95+
'Doc': true
96+
'env': true
8297
overrides:
8398
- files: tests/**/*.test.{js,ts}
8499
plugins:

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@
6565
"eslint-config-prettier": "^8.5.0",
6666
"eslint-import-resolver-typescript": "^3.5.2",
6767
"eslint-plugin-eslint-comments": "^3.2.0",
68-
"eslint-plugin-filenames": "^1.3.2",
6968
"eslint-plugin-import": "^2.26.0",
7069
"eslint-plugin-jsdoc": "^39.6.2",
70+
"eslint-plugin-unicorn": "^44.0.2",
7171
"eslint-plugin-vitest": "^0.0.18",
7272
"npm-run-all": "^4.1.5",
7373
"prettier-plugin-jsdoc": "^0.4.2",

0 commit comments

Comments
 (0)