@wowlab/eslint-config 0.1.3 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -1
- package/dist/core/base.js +1 -1
- package/dist/core/rules/function-padding.js +2 -2
- package/dist/presets/react.js +1 -1
- package/dist/presets/typescript.js +3 -3
- package/package.json +17 -17
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@ Composable ESLint flat configs for JavaScript and TypeScript
|
|
|
7
7
|
## Getting started
|
|
8
8
|
|
|
9
9
|
```console
|
|
10
|
-
pnpm add --save-dev @wowlab/eslint-config eslint typescript
|
|
10
|
+
pnpm add --save-dev @wowlab/eslint-config eslint@10 typescript@6.0
|
|
11
11
|
```
|
|
12
12
|
|
|
13
13
|
```js
|
|
@@ -38,6 +38,11 @@ export default createConfig({
|
|
|
38
38
|
|
|
39
39
|
`createConfig` includes the base rules. Consumer rules and overrides are applied last.
|
|
40
40
|
|
|
41
|
+
Requires ESLint 10.4 or newer within version 10 and TypeScript 5.6 through 6.0.
|
|
42
|
+
Runtime dependencies use exact versions so plugin updates are tested before release.
|
|
43
|
+
Transitive dependencies can still update; commit your project's lockfile and generate
|
|
44
|
+
it using the same pnpm release-age policy as CI.
|
|
45
|
+
|
|
41
46
|
## Presets
|
|
42
47
|
|
|
43
48
|
- `deno` adds Deno globals.
|
package/dist/core/base.js
CHANGED
|
@@ -55,7 +55,7 @@ export function createBaseConfig({ internalPatterns = [], } = {}) {
|
|
|
55
55
|
],
|
|
56
56
|
},
|
|
57
57
|
},
|
|
58
|
-
unicorn.configs
|
|
58
|
+
unicorn.configs.recommended,
|
|
59
59
|
sonarjs.configs.recommended,
|
|
60
60
|
comments.recommended,
|
|
61
61
|
{ name: "wowlab/rule-defaults", rules: ruleOverrides },
|
|
@@ -13,7 +13,7 @@ function functionDeclaration(statement) {
|
|
|
13
13
|
name: declaration.id?.name,
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
|
-
function
|
|
16
|
+
function isSameOverloadGroup(current, previous) {
|
|
17
17
|
return (!previous.implementation &&
|
|
18
18
|
current.name != null &&
|
|
19
19
|
current.name === previous.name);
|
|
@@ -47,7 +47,7 @@ export const functionPadding = {
|
|
|
47
47
|
const startLine = firstAttachedLine(current, previous);
|
|
48
48
|
if (!currentFunction ||
|
|
49
49
|
!previousFunction ||
|
|
50
|
-
|
|
50
|
+
isSameOverloadGroup(currentFunction, previousFunction) ||
|
|
51
51
|
startLine > previous.loc.end.line + 1) {
|
|
52
52
|
continue;
|
|
53
53
|
}
|
package/dist/presets/react.js
CHANGED
|
@@ -44,7 +44,7 @@ export function react({ files = JAVASCRIPT_FILES, tsconfigRootDir, typeChecked =
|
|
|
44
44
|
languageOptions: {
|
|
45
45
|
parserOptions: {
|
|
46
46
|
projectService: true,
|
|
47
|
-
...(tsconfigRootDir
|
|
47
|
+
...(tsconfigRootDir && { tsconfigRootDir }),
|
|
48
48
|
},
|
|
49
49
|
},
|
|
50
50
|
name: "wowlab/react/typescript/project-service",
|
|
@@ -8,15 +8,15 @@ export function typescript({ files = ["**/*.{ts,tsx,mts,cts}"], tsconfigRootDir,
|
|
|
8
8
|
? {
|
|
9
9
|
...config.languageOptions,
|
|
10
10
|
parserOptions: {
|
|
11
|
-
...(typeChecked
|
|
12
|
-
...(tsconfigRootDir
|
|
11
|
+
...(typeChecked && { projectService: true }),
|
|
12
|
+
...(tsconfigRootDir && { tsconfigRootDir }),
|
|
13
13
|
},
|
|
14
14
|
}
|
|
15
15
|
: undefined;
|
|
16
16
|
return {
|
|
17
17
|
...config,
|
|
18
18
|
files,
|
|
19
|
-
...(languageOptions
|
|
19
|
+
...(languageOptions && { languageOptions }),
|
|
20
20
|
name: config.name?.replace("typescript-eslint/", "wowlab/typescript/"),
|
|
21
21
|
};
|
|
22
22
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wowlab/eslint-config",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Composable ESLint flat configs for JavaScript and TypeScript",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -37,23 +37,23 @@
|
|
|
37
37
|
"access": "public"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
|
-
"eslint": "^10.
|
|
41
|
-
"typescript": ">=
|
|
40
|
+
"eslint": "^10.4.0",
|
|
41
|
+
"typescript": ">=5.6.0 <6.1.0"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@eslint-community/eslint-plugin-eslint-comments": "
|
|
45
|
-
"@eslint-react/eslint-plugin": "
|
|
46
|
-
"@eslint/config-helpers": "
|
|
47
|
-
"@eslint/js": "
|
|
48
|
-
"@next/eslint-plugin-next": "16.
|
|
49
|
-
"@stylistic/eslint-plugin": "
|
|
50
|
-
"@tanstack/eslint-plugin-query": "
|
|
51
|
-
"eslint-plugin-perfectionist": "
|
|
52
|
-
"eslint-plugin-react-hooks": "
|
|
53
|
-
"eslint-plugin-sonarjs": "
|
|
54
|
-
"eslint-plugin-switch-case": "
|
|
55
|
-
"eslint-plugin-unicorn": "
|
|
56
|
-
"globals": "
|
|
57
|
-
"typescript-eslint": "8.
|
|
44
|
+
"@eslint-community/eslint-plugin-eslint-comments": "4.8.1",
|
|
45
|
+
"@eslint-react/eslint-plugin": "5.28.8",
|
|
46
|
+
"@eslint/config-helpers": "0.7.0",
|
|
47
|
+
"@eslint/js": "10.0.1",
|
|
48
|
+
"@next/eslint-plugin-next": "16.4.5",
|
|
49
|
+
"@stylistic/eslint-plugin": "5.10.0",
|
|
50
|
+
"@tanstack/eslint-plugin-query": "5.107.1",
|
|
51
|
+
"eslint-plugin-perfectionist": "5.13.0",
|
|
52
|
+
"eslint-plugin-react-hooks": "7.1.1",
|
|
53
|
+
"eslint-plugin-sonarjs": "4.2.2",
|
|
54
|
+
"eslint-plugin-switch-case": "4.0.0",
|
|
55
|
+
"eslint-plugin-unicorn": "79.0.0",
|
|
56
|
+
"globals": "17.14.0",
|
|
57
|
+
"typescript-eslint": "8.72.1"
|
|
58
58
|
}
|
|
59
59
|
}
|