Skip to content

Commit c737772

Browse files
committed
refactor: update
1 parent 8cc9a1b commit c737772

File tree

109 files changed

+5715
-5359
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+5715
-5359
lines changed

.changeset/clear-symbols-accept.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@masknet/eslint-plugin': patch
3+
---
4+
5+
Support string as import name

.changeset/slimy-lands-marry.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@masknet/eslint-plugin': minor
3+
---
4+
5+
Bump Node.js version requirement to 22

.changeset/solid-maps-joke.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@masknet/eslint-plugin': minor
3+
---
4+
5+
Bump eslint version requirement to 9

.changeset/weak-cycles-enjoy.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@masknet/eslint-plugin': minor
3+
---
4+
5+
prefer-defer-import rule drops the webpack magic comment syntax and adopts the native syntax

README.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@ Add `@masknet` to the plugins section of your `.eslintrc` configuration file.
4444
"@masknet/type/no-const-enum": "error",
4545
"@masknet/type/no-empty-literal": "error",
4646
"@masknet/type/no-force-cast-via-top-type": "error",
47-
"unicorn/no-instanceof-array": "off",
48-
"@masknet/type/no-instanceof-wrapper": "error",
4947
"@masknet/type/no-number-constructor": "error",
5048
"@masknet/type/no-wrapper-type-reference": "error",
5149
"@masknet/type/prefer-return-type-annotation": "warn",
@@ -121,8 +119,6 @@ Add `@masknet` to the plugins section of your `.eslintrc` configuration file.
121119
Disallow empty {array,object} literal
122120
- [type/no-force-cast-via-top-type][type$no_force_cast_via_top_type] :white_check_mark:\
123121
Disallowing cast a type `T` to unrelated or incompatible type `Q` via `T as any as Q`
124-
- [type/no-instanceof-wrapper][type$no_instanceof_wrapper] :white_check_mark: :wrench:\
125-
Disallow `instanceof` for wrapper objects
126122
- [type/no-number-constructor][type$no_number_constructor] :white_check_mark:\
127123
Disallow use `Number` constructor
128124
- [type/no-wrapper-type-reference][type$no_wrapper_type_reference] :white_check_mark: :wrench:\
@@ -156,7 +152,7 @@ Add `@masknet` to the plugins section of your `.eslintrc` configuration file.
156152
- [prefer-default-export][prefer_default_export] :white_check_mark: :gear:\
157153
Enforce default export location at top or bottom
158154
- [prefer-defer-import][prefer_defer_import] :wrench: :gear:\
159-
Prefer defer import a module. See <https://github.com/tc39/proposal-defer-import-eval> and <https://github.com/webpack/webpack/pull/16567/>.
155+
Prefer defer import a module.
160156
- [prefer-early-return][prefer_early_return] :white_check_mark: :wrench: :gear:\
161157
Prefer early returns over full-body conditional wrapping in function declarations
162158
- [prefer-fetch][prefer_fetch] :white_check_mark:\
@@ -183,7 +179,6 @@ Add `@masknet` to the plugins section of your `.eslintrc` configuration file.
183179
[type$no_const_enum]: https://dimensiondev.github.io/eslint-plugin/src/rules/type/no-const-enum
184180
[type$no_empty_literal]: https://dimensiondev.github.io/eslint-plugin/src/rules/type/no-empty-literal
185181
[type$no_force_cast_via_top_type]: https://dimensiondev.github.io/eslint-plugin/src/rules/type/no-force-cast-via-top-type
186-
[type$no_instanceof_wrapper]: https://dimensiondev.github.io/eslint-plugin/src/rules/type/no-instanceof-wrapper
187182
[type$no_number_constructor]: https://dimensiondev.github.io/eslint-plugin/src/rules/type/no-number-constructor
188183
[type$no_wrapper_type_reference]: https://dimensiondev.github.io/eslint-plugin/src/rules/type/no-wrapper-type-reference
189184
[type$prefer_return_type_annotation]: https://dimensiondev.github.io/eslint-plugin/src/rules/type/prefer-return-type-annotation

configs/all.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@
2121
"@masknet/type/no-const-enum": "error",
2222
"@masknet/type/no-empty-literal": "error",
2323
"@masknet/type/no-force-cast-via-top-type": "error",
24-
"unicorn/no-instanceof-array": "off",
25-
"@masknet/type/no-instanceof-wrapper": "error",
2624
"@masknet/type/no-number-constructor": "error",
2725
"@masknet/type/no-wrapper-type-reference": "error",
2826
"@masknet/type/prefer-return-type-annotation": "warn",

configs/fixable.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
"@masknet/array/prefer-from": "error",
66
"@masknet/string/no-locale-case": "error",
77
"@masknet/type/no-const-enum": "error",
8-
"unicorn/no-instanceof-array": "off",
9-
"@masknet/type/no-instanceof-wrapper": "error",
108
"@masknet/type/no-wrapper-type-reference": "error",
119
"@masknet/unicode/no-bidi": "error",
1210
"@masknet/unicode/no-invisible": "error",

configs/recommended.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
"@masknet/type/no-const-enum": "error",
1313
"@masknet/type/no-empty-literal": "error",
1414
"@masknet/type/no-force-cast-via-top-type": "error",
15-
"unicorn/no-instanceof-array": "off",
16-
"@masknet/type/no-instanceof-wrapper": "error",
1715
"@masknet/type/no-number-constructor": "error",
1816
"@masknet/type/no-wrapper-type-reference": "error",
1917
"@masknet/unicode/no-bidi": "error",

eslint.config.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,17 @@ import tslint from 'typescript-eslint'
44
import plugin from 'eslint-plugin-eslint-plugin'
55

66
export default tslint.config(
7+
{
8+
ignores: ['lib'],
9+
},
10+
//
711
eslint.configs.recommended,
8-
...tslint.configs.recommended,
9-
plugin.configs['flat/recommended'],
12+
tslint.configs.recommended,
13+
plugin.configs.recommended,
14+
{
15+
rules: {
16+
'eslint-plugin/require-meta-schema-description': 'off',
17+
'eslint-plugin/require-meta-default-options': 'off',
18+
},
19+
},
1020
)

package.json

Lines changed: 28 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@masknet/eslint-plugin",
3-
"packageManager": "pnpm@8.15.1",
3+
"packageManager": "pnpm@10.14.0",
44
"type": "module",
55
"version": "0.3.0",
66
"description": "eslint plugin for masknet",
@@ -33,13 +33,14 @@
3333
"lib/",
3434
"!src/scripts",
3535
"!lib/scripts",
36+
"!scripts",
3637
"!src/spec.ts",
3738
"!lib/spec.*",
3839
"!lib/**/*.spec.js",
3940
"!lib/**/*.spec.d.ts"
4041
],
4142
"scripts": {
42-
"generate": "node --loader ts-node/esm/transpile-only ./src/scripts/generate/index.ts",
43+
"generate": "node ./scripts/index.ts",
4344
"lint": "eslint . --fix",
4445
"markdownlint": "markdownlint .",
4546
"prepare": "husky install",
@@ -54,33 +55,36 @@
5455
]
5556
},
5657
"devDependencies": {
57-
"@changesets/cli": "^2.27.1",
58-
"@commitlint/config-conventional": "^19.2.2",
59-
"@eslint/js": "^9.0.0",
58+
"@changesets/cli": "^2.29.5",
59+
"@commitlint/config-conventional": "^19.8.1",
60+
"@eslint/js": "^9.32.0",
6061
"@masknet/config": "^0.2.1",
61-
"@types/glob": "^8.1.0",
62-
"commitlint": "^19.2.2",
63-
"cspell": "^8.7.0",
64-
"eslint": "^9.0.0",
65-
"eslint-plugin-eslint-plugin": "^6.0.0",
66-
"eslint-plugin-import": "^2.29.1",
67-
"glob": "^10.3.12",
68-
"globals": "^15.0.0",
69-
"husky": "^9.0.11",
70-
"json-schema-to-typescript": "^13.1.2",
71-
"lint-staged": "^15.2.2",
72-
"markdownlint-cli": "^0.39.0",
73-
"prettier": "^3.2.5",
62+
"@typescript-eslint/parser": "^8.39.0",
63+
"@typescript-eslint/rule-tester": "^8.39.0",
64+
"@typescript-eslint/scope-manager": "^8.39.0",
65+
"@typescript-eslint/types": "^8.39.0",
66+
"@typescript-eslint/utils": "^8.39.0",
67+
"commitlint": "^19.8.1",
68+
"cspell": "^9.2.0",
69+
"eslint": "^9.32.0",
70+
"eslint-plugin-eslint-plugin": "^7.0.0",
71+
"eslint-plugin-import": "^2.32.0",
72+
"glob": "^11.0.3",
73+
"globals": "^16.3.0",
74+
"husky": "^9.1.7",
75+
"json-schema-to-typescript": "^15.0.4",
76+
"lint-staged": "^16.1.4",
77+
"markdownlint-cli": "^0.45.0",
78+
"prettier": "^3.6.2",
7479
"ts-dedent": "^2.2.0",
75-
"ts-node": "^10.9.2",
76-
"typescript": "^5.4.5",
77-
"typescript-eslint": "^7.6.0",
78-
"vitest": "^1.5.0"
80+
"typescript": "^5.9.2",
81+
"typescript-eslint": "^8.39.0",
82+
"vitest": "^3.2.4"
7983
},
8084
"peerDependencies": {
81-
"eslint": ">= 8"
85+
"eslint": ">= 9"
8286
},
8387
"engines": {
84-
"node": ">= 18"
88+
"node": ">= 22"
8589
}
8690
}

0 commit comments

Comments
 (0)