Skip to content

Commit 011f596

Browse files
feat: more rules and fixups
1 parent 72b9a18 commit 011f596

11 files changed

+184
-55
lines changed

.github/workflows/lint-prettier.yml

-14
This file was deleted.

.github/workflows/release.yml

-3
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ jobs:
2525
uses: ./.github/workflows/lint-markdown.yml
2626
lint_packages:
2727
uses: ./.github/workflows/lint-packages.yml
28-
lint_prettier:
29-
uses: ./.github/workflows/lint-prettier.yml
3028
lint_spelling:
3129
uses: ./.github/workflows/lint-spelling.yml
3230
type_check:
@@ -39,7 +37,6 @@ jobs:
3937
- lint_knip_prod
4038
- lint_markdown
4139
- lint_packages
42-
- lint_prettier
4340
- lint_spelling
4441
- type_check
4542
runs-on: ubuntu-latest

.lintstagedrc.yml

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
"*.{json,yml}":
2-
- prettier --ignore-unknown --write
2+
- eslint --fix
33
- cspell lint --no-progress --show-suggestions --show-context --no-must-find-files --dot
44

55
"*.ts":
6-
- prettier --ignore-unknown --write
76
- eslint --fix
87
- cspell lint --no-progress --show-suggestions --show-context --no-must-find-files --dot
98
- tsc-files -p tsconfig.build.json --noEmit
109

1110
"*.md":
12-
- prettier --ignore-unknown --write
11+
- eslint --fix
1312
- markdownlint --config=.markdownlint.json --ignore-path=.markdownlintignore
1413
- cspell lint --no-progress --show-suggestions --show-context --no-must-find-files --dot
1514

.vscode/settings.json

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
{
22
"editor.codeActionsOnSave": {
3-
"source.fixAll": "explicit",
4-
"source.fixAll.eslint": "explicit",
5-
"source.formatDocument": "explicit",
6-
"source.organizeImports": "explicit",
7-
"source.sortImports": "explicit"
3+
"source.fixAll.eslint": "explicit"
84
},
95
"editor.defaultFormatter": "esbenp.prettier-vscode",
106
"editor.formatOnSave": true,

package.json

+10-7
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@
3737
"build": "pnpm run build:node",
3838
"build:node": "rimraf dist && pnpm run typegen && rollup -c rollup.config.ts --configPlugin rollup-plugin-ts",
3939
"cz": "git-cz",
40-
"lint": "pnpm run typegen && pnpm run lint:js && pnpm run lint:md && pnpm run lint:prettier && pnpm run lint:knip && pnpm run lint:spelling && pnpm run lint:packages",
41-
"lint-fix": "pnpm run typegen && pnpm run lint:js-fix && pnpm run lint:prettier-fix && pnpm run lint:packages-fix",
40+
"lint": "pnpm run typegen && pnpm run lint:js && pnpm run lint:md && pnpm run lint:knip && pnpm run lint:spelling && pnpm run lint:packages",
41+
"lint-fix": "pnpm run typegen && pnpm run lint:js-fix && pnpm run lint:packages-fix",
4242
"lint:js": "eslint .",
4343
"lint:js-fix": "eslint . --fix",
4444
"lint:knip": "pnpm run lint:knip:development && pnpm run lint:knip:production",
@@ -47,8 +47,6 @@
4747
"lint:md": "markdownlint \"**/*.md\" --config=.markdownlint.json --ignore-path=.markdownlintignore",
4848
"lint:packages": "pnpm dedupe --check",
4949
"lint:packages-fix": "pnpm dedupe",
50-
"lint:prettier": "prettier \"**/*\" --ignore-unknown --list-different",
51-
"lint:prettier-fix": "prettier \"**/*\" --ignore-unknown --write",
5250
"lint:spelling": "cspell \"**\" \".github/**/*\"",
5351
"prepare": "husky && pnpm run typegen",
5452
"release": "semantic-release",
@@ -91,7 +89,7 @@
9189
"eslint-plugin-eslint-comments": "3.2.0",
9290
"eslint-plugin-format": "0.1.0",
9391
"eslint-plugin-functional": "6.3.0",
94-
"eslint-plugin-import": "2.29.1",
92+
"eslint-plugin-import-x": "0.5.0",
9593
"eslint-plugin-jsdoc": "48.2.1",
9694
"eslint-plugin-jsonc": "2.14.1",
9795
"eslint-plugin-markdown": "4.0.1",
@@ -101,6 +99,7 @@
10199
"eslint-plugin-perfectionist": "2.7.0",
102100
"eslint-plugin-prettier": "5.1.3",
103101
"eslint-plugin-promise": "6.1.1",
102+
"eslint-plugin-regexp": "2.4.0",
104103
"eslint-plugin-sonarjs": "0.24.0",
105104
"eslint-plugin-toml": "0.10.0",
106105
"eslint-plugin-unicorn": "51.0.1",
@@ -145,7 +144,7 @@
145144
"eslint-plugin-eslint-comments": "*",
146145
"eslint-plugin-format": "*",
147146
"eslint-plugin-functional": "*",
148-
"eslint-plugin-import": "*",
147+
"eslint-plugin-import-x": "*",
149148
"eslint-plugin-jsdoc": "*",
150149
"eslint-plugin-jsonc": "*",
151150
"eslint-plugin-markdown": "*",
@@ -155,6 +154,7 @@
155154
"eslint-plugin-perfectionist": "*",
156155
"eslint-plugin-prettier": "*",
157156
"eslint-plugin-promise": "*",
157+
"eslint-plugin-regexp": "*",
158158
"eslint-plugin-sonarjs": "*",
159159
"eslint-plugin-toml": "*",
160160
"eslint-plugin-unicorn": "*",
@@ -207,7 +207,7 @@
207207
"eslint-plugin-functional": {
208208
"optional": true
209209
},
210-
"eslint-plugin-import": {
210+
"eslint-plugin-import-x": {
211211
"optional": true
212212
},
213213
"eslint-plugin-jsdoc": {
@@ -237,6 +237,9 @@
237237
"eslint-plugin-promise": {
238238
"optional": true
239239
},
240+
"eslint-plugin-regexp": {
241+
"optional": true
242+
},
240243
"eslint-plugin-sonarjs": {
241244
"optional": true
242245
},

pnpm-lock.yaml

+78-8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

project-dictionary.txt

+2
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,11 @@ jiti
1414
knip
1515
litecoin
1616
lockb
17+
lookarounds
1718
monero
1819
nocheck
1920
noreply
21+
nums
2022
nuxt
2123
plugh
2224
quux

src/configs/imports.ts

+13-5
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export async function imports(
99
): Promise<FlatConfigItem[]> {
1010
const { stylistic = true } = options;
1111

12-
const [pluginImport] = (await loadPackages(["eslint-plugin-import"])) as [
12+
const [pluginImport] = (await loadPackages(["eslint-plugin-import-x"])) as [
1313
ESLint.Plugin,
1414
];
1515

@@ -20,11 +20,19 @@ export async function imports(
2020
import: pluginImport,
2121
},
2222
settings: {
23-
"import/external-module-folders": ["node_modules"],
24-
"import/internal-regex": "^(?:#|(?:@|~)\\/).*",
25-
"import/resolver": {
23+
"import-x/external-module-folders": [
24+
"node_modules",
25+
"node_modules/@types",
26+
],
27+
"import-x/internal-regex": "^(?:#|(?:@|~)\\/).*",
28+
"import-x/extensions": [".ts", ".tsx", ".js", ".jsx"],
29+
"import-x/parsers": {
30+
"@typescript-eslint/parser": [".ts", ".tsx", ".cts", ".mts"],
31+
},
32+
"import-x/resolver": {
33+
typescript: true,
2634
node: {
27-
extensions: ["js", "cjs", "mjs", "ts", "cts", "mts", "jsx", "tsx"],
35+
extensions: [".ts", ".tsx", ".js", ".jsx"],
2836
},
2937
},
3038
},

0 commit comments

Comments
 (0)