@rootreeweb/linting 4.2.9 → 5.0.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 +31 -10
- package/dist/esm/eslint/astro.d.ts.map +1 -1
- package/dist/esm/eslint/astro.js +3 -2
- package/dist/esm/eslint/astro.js.map +1 -1
- package/dist/esm/eslint/basic.d.ts.map +1 -1
- package/dist/esm/eslint/basic.js +6 -3
- package/dist/esm/eslint/basic.js.map +1 -1
- package/dist/esm/eslint/index.d.ts +2 -0
- package/dist/esm/eslint/index.d.ts.map +1 -1
- package/dist/esm/eslint/index.js +7 -8
- package/dist/esm/eslint/index.js.map +1 -1
- package/dist/esm/eslint/jsdoc.d.ts.map +1 -1
- package/dist/esm/eslint/jsdoc.js +3 -2
- package/dist/esm/eslint/jsdoc.js.map +1 -1
- package/dist/esm/eslint/next.d.ts.map +1 -1
- package/dist/esm/eslint/next.js +3 -2
- package/dist/esm/eslint/next.js.map +1 -1
- package/dist/esm/eslint/packageJson.d.ts +3 -0
- package/dist/esm/eslint/packageJson.d.ts.map +1 -0
- package/dist/esm/eslint/packageJson.js +19 -0
- package/dist/esm/eslint/packageJson.js.map +1 -0
- package/dist/esm/eslint/react.d.ts.map +1 -1
- package/dist/esm/eslint/react.js +3 -2
- package/dist/esm/eslint/react.js.map +1 -1
- package/dist/esm/eslint/tailwind.d.ts.map +1 -1
- package/dist/esm/eslint/tailwind.js +3 -2
- package/dist/esm/eslint/tailwind.js.map +1 -1
- package/dist/esm/eslint/turbo.d.ts.map +1 -1
- package/dist/esm/eslint/turbo.js +3 -2
- package/dist/esm/eslint/turbo.js.map +1 -1
- package/dist/esm/eslint/utils.d.ts +36 -0
- package/dist/esm/eslint/utils.d.ts.map +1 -1
- package/dist/esm/eslint/utils.js +50 -0
- package/dist/esm/eslint/utils.js.map +1 -1
- package/dist/esm/lintStaged.d.ts.map +1 -1
- package/dist/esm/lintStaged.js +41 -19
- package/dist/esm/lintStaged.js.map +1 -1
- package/dist/esm/prettier.d.ts.map +1 -1
- package/dist/esm/prettier.js +0 -1
- package/dist/esm/prettier.js.map +1 -1
- package/dist/esm/stylelint/basic.d.ts.map +1 -1
- package/dist/esm/stylelint/basic.js +6 -2
- package/dist/esm/stylelint/basic.js.map +1 -1
- package/package.json +47 -36
package/README.md
CHANGED
|
@@ -36,6 +36,26 @@ import { presetBase } from "@rootreeweb/linting";
|
|
|
36
36
|
export default presetBase;
|
|
37
37
|
```
|
|
38
38
|
|
|
39
|
+
### Adding Your Own Rules
|
|
40
|
+
|
|
41
|
+
Use `composeConfig` any time you're combining presets/modules with your own
|
|
42
|
+
rules, or combining several modules yourself (the "Mix and Match" case
|
|
43
|
+
below). It deduplicates plugin definitions and makes sure none of your own
|
|
44
|
+
additions accidentally apply to `package.json` (which this package lints as
|
|
45
|
+
JSON, not JS/TS, via `eslint-package-json`) — a plain rule block with no
|
|
46
|
+
`files` restriction otherwise applies to every file, including
|
|
47
|
+
`package.json`, and can crash rules that assume a JS source file.
|
|
48
|
+
|
|
49
|
+
```javascript
|
|
50
|
+
import { composeConfig, presetBase } from "@rootreeweb/linting";
|
|
51
|
+
|
|
52
|
+
export default composeConfig(presetBase, {
|
|
53
|
+
rules: {
|
|
54
|
+
"no-console": "warn",
|
|
55
|
+
},
|
|
56
|
+
});
|
|
57
|
+
```
|
|
58
|
+
|
|
39
59
|
### Mix and Match
|
|
40
60
|
|
|
41
61
|
Available modules:
|
|
@@ -50,6 +70,7 @@ Available modules:
|
|
|
50
70
|
```javascript
|
|
51
71
|
import {
|
|
52
72
|
basic,
|
|
73
|
+
composeConfig,
|
|
53
74
|
jsdoc,
|
|
54
75
|
next,
|
|
55
76
|
react,
|
|
@@ -57,13 +78,13 @@ import {
|
|
|
57
78
|
turbo,
|
|
58
79
|
} from "@rootreeweb/linting";
|
|
59
80
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
81
|
+
export default composeConfig(
|
|
82
|
+
basic,
|
|
83
|
+
jsdoc,
|
|
84
|
+
react,
|
|
85
|
+
tailwind,
|
|
86
|
+
next,
|
|
87
|
+
turbo,
|
|
67
88
|
{
|
|
68
89
|
rules: {
|
|
69
90
|
"tailwindcss/no-contradicting-classname": "warn",
|
|
@@ -78,15 +99,15 @@ const config = [
|
|
|
78
99
|
{
|
|
79
100
|
ignores: ["data"],
|
|
80
101
|
},
|
|
81
|
-
|
|
102
|
+
);
|
|
82
103
|
```
|
|
83
104
|
|
|
84
105
|
Next preset with TurboRepo example:
|
|
85
106
|
|
|
86
107
|
```javascript
|
|
87
|
-
import { presetNext, turbo } from "@rootreeweb/linting";
|
|
108
|
+
import { composeConfig, presetNext, turbo } from "@rootreeweb/linting";
|
|
88
109
|
|
|
89
|
-
export default
|
|
110
|
+
export default composeConfig(presetNext, turbo);
|
|
90
111
|
```
|
|
91
112
|
|
|
92
113
|
## Stylelint
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"astro.d.ts","sourceRoot":"","sources":["../../../src/eslint/astro.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"astro.d.ts","sourceRoot":"","sources":["../../../src/eslint/astro.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAqBrC,eAAO,MAAM,KAAK,EAAE,MAAM,CAAC,MAAM,EAW/B,CAAC"}
|
package/dist/esm/eslint/astro.js
CHANGED
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
// @ts-ignore
|
|
4
4
|
import { configs } from "eslint-plugin-astro";
|
|
5
5
|
import { jsxA11y } from "./plugins.js";
|
|
6
|
-
|
|
6
|
+
import { excludePackageJsonFromAll } from "./utils.js";
|
|
7
|
+
const astroBase = excludePackageJsonFromAll([
|
|
7
8
|
...configs["flat/all"],
|
|
8
9
|
...configs["flat/jsx-a11y-strict"],
|
|
9
10
|
{
|
|
@@ -13,7 +14,7 @@ const astroBase = [
|
|
|
13
14
|
},
|
|
14
15
|
},
|
|
15
16
|
{ ignores: ["**/*.d.ts"] },
|
|
16
|
-
];
|
|
17
|
+
]);
|
|
17
18
|
export const astro = astroBase.map((config) => {
|
|
18
19
|
if (config.plugins?.["jsx-a11y"]) {
|
|
19
20
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"astro.js","sourceRoot":"","sources":["../../../src/eslint/astro.ts"],"names":[],"mappings":"AACA,kIAAkI;AAClI,4DAA4D;AAC5D,aAAa;AACb,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAE9C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"astro.js","sourceRoot":"","sources":["../../../src/eslint/astro.ts"],"names":[],"mappings":"AACA,kIAAkI;AAClI,4DAA4D;AAC5D,aAAa;AACb,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAE9C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC;AAEvD,MAAM,SAAS,GAAoB,yBAAyB,CAAC;IAC5D,GAAG,OAAO,CAAC,UAAU,CAAC;IACtB,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAClC;QACC,KAAK,EAAE;YACN,sBAAsB,EAAE,KAAK,EAAE,0CAA0C;YACzE,kCAAkC,EAAE,KAAK;SACzC;KACD;IACD,EAAE,OAAO,EAAE,CAAC,WAAW,CAAC,EAAE;CAC1B,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,KAAK,GAAoB,SAAS,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;IAC9D,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC,UAAU,CAAC,EAAE,CAAC;QAClC,OAAO;YACN,GAAG,MAAM;YACT,OAAO,EAAE;gBACR,GAAG,MAAM,CAAC,OAAO;gBACjB,UAAU,EAAE,OAAO;aACnB;SACD,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC;AACf,CAAC,CAAC,CAAC","sourcesContent":["import type { Linter } from \"eslint\";\n// CJS Workaround. Seems like only the default exists in the CJS package, not using expect error because there is no error in ESM.\n//eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore\nimport { configs } from \"eslint-plugin-astro\";\n\nimport { jsxA11y } from \"./plugins.js\";\nimport { excludePackageJsonFromAll } from \"./utils.js\";\n\nconst astroBase: Linter.Config[] = excludePackageJsonFromAll([\n\t...configs[\"flat/all\"],\n\t...configs[\"flat/jsx-a11y-strict\"],\n\t{\n\t\trules: {\n\t\t\t\"import/no-unresolved\": \"off\", //These rules conflict with astro:content.\n\t\t\t\"sonarjs/no-implicit-dependencies\": \"off\",\n\t\t},\n\t},\n\t{ ignores: [\"**/*.d.ts\"] },\n]);\n\nexport const astro: Linter.Config[] = astroBase.map((config) => {\n\tif (config.plugins?.[\"jsx-a11y\"]) {\n\t\treturn {\n\t\t\t...config,\n\t\t\tplugins: {\n\t\t\t\t...config.plugins,\n\t\t\t\t\"jsx-a11y\": jsxA11y,\n\t\t\t},\n\t\t};\n\t}\n\treturn config;\n});\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"basic.d.ts","sourceRoot":"","sources":["../../../src/eslint/basic.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"basic.d.ts","sourceRoot":"","sources":["../../../src/eslint/basic.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAmBrC,eAAO,MAAM,KAAK,EAAE,MAAM,CAAC,MAAM,EA2I/B,CAAC"}
|
package/dist/esm/eslint/basic.js
CHANGED
|
@@ -10,10 +10,12 @@ import sonarjs from "eslint-plugin-sonarjs";
|
|
|
10
10
|
import { defineConfig } from "eslint/config";
|
|
11
11
|
import globals from "globals";
|
|
12
12
|
import tseslint from "typescript-eslint";
|
|
13
|
+
import { packageJson } from "./packageJson.js";
|
|
13
14
|
import { applyPatches } from "./patches/index.js";
|
|
15
|
+
import { excludePackageJsonFromAll } from "./utils.js";
|
|
14
16
|
// Apply all custom plugin patches before building configs.
|
|
15
17
|
applyPatches({ sonarjs: sonarjs });
|
|
16
|
-
export const basic = [
|
|
18
|
+
export const basic = excludePackageJsonFromAll([
|
|
17
19
|
eslint.configs.recommended,
|
|
18
20
|
...tseslint.configs.strictTypeChecked,
|
|
19
21
|
...tseslint.configs.stylisticTypeChecked,
|
|
@@ -43,7 +45,7 @@ export const basic = [
|
|
|
43
45
|
"perfectionist/sort-named-imports": "off",
|
|
44
46
|
"promise/always-return": "off",
|
|
45
47
|
"promise/catch-or-return": "off",
|
|
46
|
-
"sonarjs/argument-type": "off", //
|
|
48
|
+
"sonarjs/argument-type": "off", // Disabled: conflicts with the internal includes definition.
|
|
47
49
|
"sonarjs/assertions-in-tests": "off",
|
|
48
50
|
"sonarjs/cognitive-complexity": "warn",
|
|
49
51
|
"sonarjs/deprecation": "off", // Double coverage with @typescript-eslint/no-deprecated
|
|
@@ -138,6 +140,7 @@ export const basic = [
|
|
|
138
140
|
"@typescript-eslint/explicit-module-boundary-types": "off",
|
|
139
141
|
},
|
|
140
142
|
}),
|
|
143
|
+
...packageJson,
|
|
141
144
|
// Global Ignores
|
|
142
145
|
{
|
|
143
146
|
ignores: [
|
|
@@ -151,5 +154,5 @@ export const basic = [
|
|
|
151
154
|
"coverage/**/*",
|
|
152
155
|
],
|
|
153
156
|
},
|
|
154
|
-
];
|
|
157
|
+
]);
|
|
155
158
|
//# sourceMappingURL=basic.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"basic.js","sourceRoot":"","sources":["../../../src/eslint/basic.ts"],"names":[],"mappings":"A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CAAyC,EAAE,MAAM;YACjD,mCAAmC,EAAE,MAAM;YAC3C,4CAA4C,EAAE,MAAM;YACpD,qCAAqC,EAAE,MAAM;YAC7C,mCAAmC,EAAE;gBACpC,OAAO;gBACP;oBACC,IAAI,EAAE,KAAK;oBACX,iBAAiB,EAAE,IAAI;oBACvB,YAAY,EAAE,KAAK;oBACnB,yBAAyB,EAAE,IAAI;oBAC/B,8BAA8B,EAAE,IAAI;oBACpC,kBAAkB,EAAE,IAAI;oBACxB,iBAAiB,EAAE,IAAI;iBACvB;aACD;YACD,8CAA8C,EAAE,MAAM;YACtD,kCAAkC,EAAE,MAAM;YAC1C,kDAAkD,EAAE;gBACnD,MAAM;gBACN,EAAE,WAAW,EAAE,IAAI,EAAE;aACrB;YACD,YAAY,EAAE,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;YACpD,WAAW,EAAE,KAAK;SAClB;KACD;IACD,GAAG,YAAY,CAAC;QACf,OAAO,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,kBAAkB,CAAC;QAC9C,KAAK,EAAE;YACN,SAAS;YACT,YAAY;YACZ,UAAU;YACV,gBAAgB;YAChB,SAAS;YACT,UAAU;SACV;QACD,KAAK,EAAE;YACN,mDAAmD,EAAE,KAAK;SAC1D;KACD,CAAC;IACF,GAAG,WAAW;IACd,iBAAiB;IACjB;QACC,OAAO,EAAE;YACR,WAAW;YACX,YAAY;YACZ,YAAY;YACZ,YAAY;YACZ,aAAa;YACb,aAAa;YACb,wBAAwB;YACxB,eAAe;SACf;KACD;CACD,CAAC,CAAC","sourcesContent":["import eslint from \"@eslint/js\";\nimport vitest from \"@vitest/eslint-plugin\";\nimport type { Linter } from \"eslint\";\nimport { createTypeScriptImportResolver } from \"eslint-import-resolver-typescript\";\nimport importPlugin from \"eslint-plugin-import\";\nimport perfectionist from \"eslint-plugin-perfectionist\";\n// @ts-expect-error TS7016 Can't get these types to work.\nimport pluginPromise from \"eslint-plugin-promise\";\nimport security from \"eslint-plugin-security\";\nimport sonarjs from \"eslint-plugin-sonarjs\";\nimport { defineConfig } from \"eslint/config\";\nimport globals from \"globals\";\nimport tseslint from \"typescript-eslint\";\n\nimport { packageJson } from \"./packageJson.js\";\nimport { applyPatches } from \"./patches/index.js\";\nimport { excludePackageJsonFromAll } from \"./utils.js\";\n\n// Apply all custom plugin patches before building configs.\napplyPatches({ sonarjs: sonarjs });\n\nexport const basic: Linter.Config[] = excludePackageJsonFromAll([\n\teslint.configs.recommended,\n\t...tseslint.configs.strictTypeChecked,\n\t...tseslint.configs.stylisticTypeChecked,\n\timportPlugin.flatConfigs.recommended,\n\tsecurity.configs.recommended,\n\t// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n\tpluginPromise.configs[\"flat/recommended\"],\n\t// eslint-disable-next-line import/no-named-as-default-member\n\tperfectionist.configs[\"recommended-natural\"],\n\t...defineConfig({\n\t\tplugins: { vitest },\n\t\trules: {\n\t\t\t...vitest.configs.recommended.rules,\n\t\t\t\"vitest/valid-expect\": [\"warn\", { maxArgs: 2 }],\n\t\t},\n\t}),\n\tsonarjs.configs.recommended,\n\t{\n\t\trules: {\n\t\t\t\"import/first\": \"error\",\n\t\t\t\"import/newline-after-import\": \"error\",\n\t\t\t\"import/no-cycle\": \"error\",\n\t\t\t\"import/no-deprecated\": \"warn\",\n\t\t\t\"import/no-duplicates\": \"error\",\n\t\t\t\"import/no-useless-path-segments\": \"error\",\n\t\t\t\"perfectionist/sort-imports\": \"off\", // Conflict with the prettier ordering\n\t\t\t\"perfectionist/sort-named-imports\": \"off\",\n\t\t\t\"promise/always-return\": \"off\",\n\t\t\t\"promise/catch-or-return\": \"off\",\n\t\t\t\"sonarjs/argument-type\": \"off\", // Disabled: conflicts with the internal includes definition.\n\t\t\t\"sonarjs/assertions-in-tests\": \"off\",\n\t\t\t\"sonarjs/cognitive-complexity\": \"warn\",\n\t\t\t\"sonarjs/deprecation\": \"off\", // Double coverage with @typescript-eslint/no-deprecated\n\t\t\t\"sonarjs/no-control-regex\": \"off\", // Double coverage\n\t\t\t\"sonarjs/no-ignored-exceptions\": \"warn\",\n\t\t\t\"sonarjs/no-implicit-dependencies\": \"warn\",\n\t\t\t\"sonarjs/no-os-command-from-path\": \"warn\",\n\t\t\t\"sonarjs/no-unused-vars\": \"off\", // Double coverage\n\t\t\t\"sonarjs/prefer-read-only-props\": \"warn\",\n\t\t\t\"sonarjs/prefer-single-boolean-return\": \"off\",\n\t\t\t\"sonarjs/pseudo-random\": \"warn\",\n\t\t\t\"sonarjs/slow-regex\": \"warn\",\n\t\t\t\"sonarjs/todo-tag\": \"warn\",\n\t\t},\n\t\tsettings: {\n\t\t\t\"import/resolver\": {\n\t\t\t\tnode: {\n\t\t\t\t\textensions: [\".js\", \".jsx\", \".ts\", \".tsx\", \".svg\", \".jpg\", \".png\"],\n\t\t\t\t},\n\t\t\t\ttypescript: {\n\t\t\t\t\textensions: [\".js\", \".jsx\", \".ts\", \".tsx\", \".svg\", \".jpg\", \".png\"],\n\t\t\t\t},\n\t\t\t},\n\t\t\t\"import/resolver-next\": [createTypeScriptImportResolver({})],\n\t\t},\n\t},\n\t{\n\t\tlanguageOptions: {\n\t\t\tecmaVersion: 2024,\n\t\t\tglobals: {\n\t\t\t\t...globals.node,\n\t\t\t\t...globals.browser,\n\t\t\t},\n\t\t\tparserOptions: {\n\t\t\t\tprojectService: true,\n\t\t\t\t// CJS Workaround\n\t\t\t\t// eslint-disable-next-line\n\t\t\t\t// @ts-ignore\n\t\t\t\ttsconfigRootDir: import.meta.dirname,\n\t\t\t},\n\t\t\tsourceType: \"module\",\n\t\t},\n\t\trules: {\n\t\t\t\"@typescript-eslint/consistent-type-definitions\": [\"error\", \"type\"],\n\t\t\t\"@typescript-eslint/consistent-type-imports\": \"error\",\n\t\t\t\"@typescript-eslint/explicit-module-boundary-types\": \"warn\",\n\t\t\t\"@typescript-eslint/no-base-to-string\": \"warn\",\n\t\t\t\"@typescript-eslint/no-explicit-any\": \"warn\",\n\t\t\t\"@typescript-eslint/no-floating-promises\": \"warn\",\n\t\t\t\"@typescript-eslint/no-misused-spread\": \"warn\",\n\t\t\t\"@typescript-eslint/no-shadow\": \"error\",\n\t\t\t\"@typescript-eslint/no-unnecessary-condition\": \"warn\",\n\t\t\t\"@typescript-eslint/no-unnecessary-type-parameters\": \"off\",\n\t\t\t\"@typescript-eslint/no-unsafe-argument\": \"warn\",\n\t\t\t\"@typescript-eslint/no-unsafe-assignment\": \"warn\",\n\t\t\t\"@typescript-eslint/no-unsafe-call\": \"warn\",\n\t\t\t\"@typescript-eslint/no-unsafe-member-access\": \"warn\",\n\t\t\t\"@typescript-eslint/no-unsafe-return\": \"warn\",\n\t\t\t\"@typescript-eslint/no-unused-vars\": [\n\t\t\t\t\"error\",\n\t\t\t\t{\n\t\t\t\t\targs: \"all\",\n\t\t\t\t\targsIgnorePattern: \"^_\",\n\t\t\t\t\tcaughtErrors: \"all\",\n\t\t\t\t\tcaughtErrorsIgnorePattern: \"^_\",\n\t\t\t\t\tdestructuredArrayIgnorePattern: \"^_\",\n\t\t\t\t\tignoreRestSiblings: true,\n\t\t\t\t\tvarsIgnorePattern: \"^_\",\n\t\t\t\t},\n\t\t\t],\n\t\t\t\"@typescript-eslint/prefer-nullish-coalescing\": \"warn\",\n\t\t\t\"@typescript-eslint/require-await\": \"warn\",\n\t\t\t\"@typescript-eslint/restrict-template-expressions\": [\n\t\t\t\t\"warn\",\n\t\t\t\t{ allowNumber: true },\n\t\t\t],\n\t\t\t\"no-console\": [\"warn\", { allow: [\"warn\", \"error\"] }],\n\t\t\t\"no-shadow\": \"off\",\n\t\t},\n\t},\n\t...defineConfig({\n\t\textends: [tseslint.configs.disableTypeChecked],\n\t\tfiles: [\n\t\t\t\"**/*.js\",\n\t\t\t\"**/*.astro\",\n\t\t\t\"**/*.cjs\",\n\t\t\t\"**/*.config.ts\",\n\t\t\t\"test.ts\",\n\t\t\t\"test.tsx\",\n\t\t],\n\t\trules: {\n\t\t\t\"@typescript-eslint/explicit-module-boundary-types\": \"off\",\n\t\t},\n\t}),\n\t...packageJson,\n\t// Global Ignores\n\t{\n\t\tignores: [\n\t\t\t\"dist/**/*\",\n\t\t\t\".tsup/**/*\",\n\t\t\t\".yarn/**/*\",\n\t\t\t\".next/**/*\",\n\t\t\t\".astro/**/*\",\n\t\t\t\"vendor/**/*\",\n\t\t\t\"playwright-report/**/*\",\n\t\t\t\"coverage/**/*\",\n\t\t],\n\t},\n]);\n"]}
|
|
@@ -4,9 +4,11 @@ export * from "./astro.js";
|
|
|
4
4
|
export * from "./basic.js";
|
|
5
5
|
export * from "./jsdoc.js";
|
|
6
6
|
export * from "./next.js";
|
|
7
|
+
export * from "./packageJson.js";
|
|
7
8
|
export * from "./react.js";
|
|
8
9
|
export * from "./tailwind.js";
|
|
9
10
|
export * from "./turbo.js";
|
|
11
|
+
export { composeConfig } from "./utils.js";
|
|
10
12
|
export declare const presetBase: Linter.Config[];
|
|
11
13
|
export declare const presetReactLite: Linter.Config[];
|
|
12
14
|
export declare const getPresetReact: (options: TailwindOptions) => Linter.Config[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/eslint/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAOrC,OAAO,EAAe,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC;AAGlE,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/eslint/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAOrC,OAAO,EAAe,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC;AAGlE,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,MAAM,EAAyB,CAAC;AAChE,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAG1C,CAAC;AACF,eAAO,MAAM,cAAc,YAAa,eAAe,KAAG,MAAM,CAAC,MAAM,EAChB,CAAC;AACxD,eAAO,MAAM,aAAa,YAAa,eAAe,KAAG,MAAM,CAAC,MAAM,EACzB,CAAC;AAC9C,eAAO,MAAM,cAAc,YAAa,eAAe,KAAG,MAAM,CAAC,MAAM,EACzB,CAAC"}
|
package/dist/esm/eslint/index.js
CHANGED
|
@@ -4,20 +4,19 @@ import { jsdoc } from "./jsdoc.js";
|
|
|
4
4
|
import { next } from "./next.js";
|
|
5
5
|
import { react } from "./react.js";
|
|
6
6
|
import { getTailwind } from "./tailwind.js";
|
|
7
|
-
import {
|
|
7
|
+
import { composeConfig } from "./utils.js";
|
|
8
8
|
export * from "./astro.js";
|
|
9
9
|
export * from "./basic.js";
|
|
10
10
|
export * from "./jsdoc.js";
|
|
11
11
|
export * from "./next.js";
|
|
12
|
+
export * from "./packageJson.js";
|
|
12
13
|
export * from "./react.js";
|
|
13
14
|
export * from "./tailwind.js";
|
|
14
15
|
export * from "./turbo.js";
|
|
16
|
+
export { composeConfig } from "./utils.js";
|
|
15
17
|
export const presetBase = [...basic, ...jsdoc];
|
|
16
|
-
export const presetReactLite =
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
export const getPresetReact = (options) => deduplicatePlugins([...presetBase, ...react, ...getTailwind(options)]);
|
|
21
|
-
export const getPresetNext = (options) => deduplicatePlugins([...getPresetReact(options), ...next]);
|
|
22
|
-
export const getPresetAstro = (options) => deduplicatePlugins([...getPresetReact(options), ...astro]);
|
|
18
|
+
export const presetReactLite = composeConfig(presetBase, react);
|
|
19
|
+
export const getPresetReact = (options) => composeConfig(presetBase, react, getTailwind(options));
|
|
20
|
+
export const getPresetNext = (options) => composeConfig(getPresetReact(options), next);
|
|
21
|
+
export const getPresetAstro = (options) => composeConfig(getPresetReact(options), astro);
|
|
23
22
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/eslint/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,WAAW,EAAwB,MAAM,eAAe,CAAC;AAClE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/eslint/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,WAAW,EAAwB,MAAM,eAAe,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C,MAAM,CAAC,MAAM,UAAU,GAAoB,CAAC,GAAG,KAAK,EAAE,GAAG,KAAK,CAAC,CAAC;AAChE,MAAM,CAAC,MAAM,eAAe,GAAoB,aAAa,CAC5D,UAAU,EACV,KAAK,CACL,CAAC;AACF,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,OAAwB,EAAmB,EAAE,CAC3E,aAAa,CAAC,UAAU,EAAE,KAAK,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC;AACxD,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,OAAwB,EAAmB,EAAE,CAC1E,aAAa,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,CAAC;AAC9C,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,OAAwB,EAAmB,EAAE,CAC3E,aAAa,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,KAAK,CAAC,CAAC","sourcesContent":["import type { Linter } from \"eslint\";\n\nimport { astro } from \"./astro.js\";\nimport { basic } from \"./basic.js\";\nimport { jsdoc } from \"./jsdoc.js\";\nimport { next } from \"./next.js\";\nimport { react } from \"./react.js\";\nimport { getTailwind, type TailwindOptions } from \"./tailwind.js\";\nimport { composeConfig } from \"./utils.js\";\n\nexport * from \"./astro.js\";\nexport * from \"./basic.js\";\nexport * from \"./jsdoc.js\";\nexport * from \"./next.js\";\nexport * from \"./packageJson.js\";\nexport * from \"./react.js\";\nexport * from \"./tailwind.js\";\nexport * from \"./turbo.js\";\nexport { composeConfig } from \"./utils.js\";\n\nexport const presetBase: Linter.Config[] = [...basic, ...jsdoc];\nexport const presetReactLite: Linter.Config[] = composeConfig(\n\tpresetBase,\n\treact,\n);\nexport const getPresetReact = (options: TailwindOptions): Linter.Config[] =>\n\tcomposeConfig(presetBase, react, getTailwind(options));\nexport const getPresetNext = (options: TailwindOptions): Linter.Config[] =>\n\tcomposeConfig(getPresetReact(options), next);\nexport const getPresetAstro = (options: TailwindOptions): Linter.Config[] =>\n\tcomposeConfig(getPresetReact(options), astro);\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jsdoc.d.ts","sourceRoot":"","sources":["../../../src/eslint/jsdoc.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"jsdoc.d.ts","sourceRoot":"","sources":["../../../src/eslint/jsdoc.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAKrC,eAAO,MAAM,KAAK,EAAE,MAAM,CAAC,MAAM,EA8B/B,CAAC"}
|
package/dist/esm/eslint/jsdoc.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import jsdocEslint from "eslint-plugin-jsdoc";
|
|
2
|
-
|
|
2
|
+
import { excludePackageJsonFromAll } from "./utils.js";
|
|
3
|
+
export const jsdoc = excludePackageJsonFromAll([
|
|
3
4
|
jsdocEslint.configs["flat/recommended-typescript"],
|
|
4
5
|
{
|
|
5
6
|
plugins: {
|
|
@@ -29,5 +30,5 @@ export const jsdoc = [
|
|
|
29
30
|
},
|
|
30
31
|
rules: { "jsdoc/check-tag-names": "off" },
|
|
31
32
|
},
|
|
32
|
-
];
|
|
33
|
+
]);
|
|
33
34
|
//# sourceMappingURL=jsdoc.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jsdoc.js","sourceRoot":"","sources":["../../../src/eslint/jsdoc.ts"],"names":[],"mappings":"AACA,OAAO,WAAW,MAAM,qBAAqB,CAAC;AAE9C,MAAM,CAAC,MAAM,KAAK,GAAoB;
|
|
1
|
+
{"version":3,"file":"jsdoc.js","sourceRoot":"","sources":["../../../src/eslint/jsdoc.ts"],"names":[],"mappings":"AACA,OAAO,WAAW,MAAM,qBAAqB,CAAC;AAE9C,OAAO,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC;AAEvD,MAAM,CAAC,MAAM,KAAK,GAAoB,yBAAyB,CAAC;IAC/D,WAAW,CAAC,OAAO,CAAC,6BAA6B,CAAC;IAClD;QACC,OAAO,EAAE;YACR,WAAW;SACX;QACD,KAAK,EAAE;YACN,4BAA4B,EAAE,OAAO;YACrC,qBAAqB,EAAE;gBACtB,OAAO;gBACP;oBACC,OAAO,EAAE;wBACR,gBAAgB,EAAE,IAAI;wBACtB,mBAAmB,EAAE,IAAI;wBACzB,gBAAgB,EAAE,IAAI;qBACtB;iBACD;aACD;YACD,wBAAwB,EAAE,MAAM;YAChC,sBAAsB,EAAE,MAAM;YAC9B,iBAAiB,EAAE,KAAK;SACxB;KACD;IACD;QACC,KAAK,EAAE,CAAC,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,CAAC;QACtD,OAAO,EAAE;YACR,KAAK,EAAE,WAAW;SAClB;QACD,KAAK,EAAE,EAAE,uBAAuB,EAAE,KAAK,EAAE;KACzC;CACD,CAAC,CAAC","sourcesContent":["import type { Linter } from \"eslint\";\nimport jsdocEslint from \"eslint-plugin-jsdoc\";\n\nimport { excludePackageJsonFromAll } from \"./utils.js\";\n\nexport const jsdoc: Linter.Config[] = excludePackageJsonFromAll([\n\tjsdocEslint.configs[\"flat/recommended-typescript\"],\n\t{\n\t\tplugins: {\n\t\t\tjsdocEslint,\n\t\t},\n\t\trules: {\n\t\t\t\"jsdoc/check-template-names\": \"error\",\n\t\t\t\"jsdoc/require-jsdoc\": [\n\t\t\t\t\"error\",\n\t\t\t\t{\n\t\t\t\t\trequire: {\n\t\t\t\t\t\tClassDeclaration: true,\n\t\t\t\t\t\tFunctionDeclaration: true,\n\t\t\t\t\t\tMethodDefinition: true,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t],\n\t\t\t\"jsdoc/require-template\": \"warn\",\n\t\t\t\"jsdoc/require-throws\": \"warn\",\n\t\t\t\"jsdoc/tag-lines\": \"off\",\n\t\t},\n\t},\n\t{\n\t\tfiles: [\"**/*.js\", \"**/*.jsx\", \"**/*.cjs\", \"**/*.mjs\"],\n\t\tplugins: {\n\t\t\tjsdoc: jsdocEslint,\n\t\t},\n\t\trules: { \"jsdoc/check-tag-names\": \"off\" },\n\t},\n]);\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"next.d.ts","sourceRoot":"","sources":["../../../src/eslint/next.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"next.d.ts","sourceRoot":"","sources":["../../../src/eslint/next.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAIrC,eAAO,MAAM,IAAI,EAAE,MAAM,CAAC,MAAM,EAY9B,CAAC"}
|
package/dist/esm/eslint/next.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import pluginNext from "@next/eslint-plugin-next";
|
|
2
|
-
|
|
2
|
+
import { excludePackageJsonFromAll } from "./utils.js";
|
|
3
|
+
export const next = excludePackageJsonFromAll([
|
|
3
4
|
{
|
|
4
5
|
plugins: {
|
|
5
6
|
"@next/next": pluginNext,
|
|
@@ -11,5 +12,5 @@ export const next = [
|
|
|
11
12
|
...pluginNext.configs.recommended.rules,
|
|
12
13
|
},
|
|
13
14
|
},
|
|
14
|
-
];
|
|
15
|
+
]);
|
|
15
16
|
//# sourceMappingURL=next.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"next.js","sourceRoot":"","sources":["../../../src/eslint/next.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAGlD,MAAM,CAAC,MAAM,IAAI,GAAoB;
|
|
1
|
+
{"version":3,"file":"next.js","sourceRoot":"","sources":["../../../src/eslint/next.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAGlD,OAAO,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC;AAEvD,MAAM,CAAC,MAAM,IAAI,GAAoB,yBAAyB,CAAC;IAC9D;QACC,OAAO,EAAE;YACR,YAAY,EAAE,UAAU;SACxB;KACD;IACD;QACC,KAAK,EAAE,CAAC,SAAS,EAAE,UAAU,CAAC;QAC9B,KAAK,EAAE;YACN,GAAG,UAAU,CAAC,OAAO,CAAC,WAAW,CAAC,KAAK;SACvC;KACD;CACD,CAAC,CAAC","sourcesContent":["import pluginNext from \"@next/eslint-plugin-next\";\nimport type { Linter } from \"eslint\";\n\nimport { excludePackageJsonFromAll } from \"./utils.js\";\n\nexport const next: Linter.Config[] = excludePackageJsonFromAll([\n\t{\n\t\tplugins: {\n\t\t\t\"@next/next\": pluginNext,\n\t\t},\n\t},\n\t{\n\t\tfiles: [\"**/*.ts\", \"**/*.tsx\"],\n\t\trules: {\n\t\t\t...pluginNext.configs.recommended.rules,\n\t\t},\n\t},\n]);\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"packageJson.d.ts","sourceRoot":"","sources":["../../../src/eslint/packageJson.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAIrC,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,MAAM,EAerC,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import packageJsonEslint from "eslint-package-json";
|
|
2
|
+
import { defineConfig } from "eslint/config";
|
|
3
|
+
export const packageJson = defineConfig({
|
|
4
|
+
extends: ["package-json/recommended"],
|
|
5
|
+
files: ["**/package.json"],
|
|
6
|
+
plugins: {
|
|
7
|
+
"package-json": packageJsonEslint,
|
|
8
|
+
},
|
|
9
|
+
rules: {
|
|
10
|
+
// prettier, stylelint, and turbo are deliberately pinned tighter than
|
|
11
|
+
// caret elsewhere in this repo, since a minor bump can silently change
|
|
12
|
+
// formatting/lint output.
|
|
13
|
+
"package-json/dependency-version-range": [
|
|
14
|
+
"error",
|
|
15
|
+
{ exceptions: ["prettier", "stylelint", "turbo"] },
|
|
16
|
+
],
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
//# sourceMappingURL=packageJson.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"packageJson.js","sourceRoot":"","sources":["../../../src/eslint/packageJson.ts"],"names":[],"mappings":"AACA,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C,MAAM,CAAC,MAAM,WAAW,GAAoB,YAAY,CAAC;IACxD,OAAO,EAAE,CAAC,0BAA0B,CAAC;IACrC,KAAK,EAAE,CAAC,iBAAiB,CAAC;IAC1B,OAAO,EAAE;QACR,cAAc,EAAE,iBAAiB;KACjC;IACD,KAAK,EAAE;QACN,sEAAsE;QACtE,uEAAuE;QACvE,0BAA0B;QAC1B,uCAAuC,EAAE;YACxC,OAAO;YACP,EAAE,UAAU,EAAE,CAAC,UAAU,EAAE,WAAW,EAAE,OAAO,CAAC,EAAE;SAClD;KACD;CACD,CAAC,CAAC","sourcesContent":["import type { Linter } from \"eslint\";\nimport packageJsonEslint from \"eslint-package-json\";\nimport { defineConfig } from \"eslint/config\";\n\nexport const packageJson: Linter.Config[] = defineConfig({\n\textends: [\"package-json/recommended\"],\n\tfiles: [\"**/package.json\"],\n\tplugins: {\n\t\t\"package-json\": packageJsonEslint,\n\t},\n\trules: {\n\t\t// prettier, stylelint, and turbo are deliberately pinned tighter than\n\t\t// caret elsewhere in this repo, since a minor bump can silently change\n\t\t// formatting/lint output.\n\t\t\"package-json/dependency-version-range\": [\n\t\t\t\"error\",\n\t\t\t{ exceptions: [\"prettier\", \"stylelint\", \"turbo\"] },\n\t\t],\n\t},\n});\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../../../src/eslint/react.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../../../src/eslint/react.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAUrC,eAAO,MAAM,KAAK,EAAE,MAAM,CAAC,MAAM,EAkD/B,CAAC"}
|
package/dist/esm/eslint/react.js
CHANGED
|
@@ -5,7 +5,8 @@ import reactHooks from "eslint-plugin-react-hooks";
|
|
|
5
5
|
import reactYouMightNotNeedAnEffect from "eslint-plugin-react-you-might-not-need-an-effect";
|
|
6
6
|
import testingLibrary from "eslint-plugin-testing-library";
|
|
7
7
|
import { jsxA11y } from "./plugins.js";
|
|
8
|
-
|
|
8
|
+
import { excludePackageJsonFromAll } from "./utils.js";
|
|
9
|
+
export const react = excludePackageJsonFromAll([
|
|
9
10
|
...pluginQuery.configs["flat/recommended"],
|
|
10
11
|
{
|
|
11
12
|
...jsxA11y.flatConfigs.recommended,
|
|
@@ -55,5 +56,5 @@ export const react = [
|
|
|
55
56
|
"testing-library/no-node-access": "warn",
|
|
56
57
|
},
|
|
57
58
|
},
|
|
58
|
-
];
|
|
59
|
+
]);
|
|
59
60
|
//# sourceMappingURL=react.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react.js","sourceRoot":"","sources":["../../../src/eslint/react.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,+BAA+B,CAAC;AAExD,OAAO,SAAS,MAAM,qBAAqB,CAAC;AAC5C,OAAO,aAAa,MAAM,8BAA8B,CAAC;AACzD,OAAO,UAAU,MAAM,2BAA2B,CAAC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E,KAAK;YAClC,+BAA+B,EAAE,MAAM;YACvC,qCAAqC,EAAE,MAAM;YAC7C,4BAA4B,EAAE,MAAM;YACpC,0BAA0B,EAAE,KAAK;YACjC,8BAA8B,EAAE,KAAK;SACrC;QACD,QAAQ,EAAE;YACT,KAAK,EAAE;gBACN,OAAO,EAAE,QAAQ;aACjB;SACD;KACD;IACD;QACC,GAAG,cAAc,CAAC,OAAO,CAAC,YAAY,CAAC;QACvC,KAAK,EAAE;YACN,eAAe;YACf,gBAAgB;YAChB,eAAe;YACf,gBAAgB;SAChB;QACD,KAAK,EAAE;YACN,gCAAgC,EAAE,MAAM;SACxC;KACD;CACD,CAAC,CAAC","sourcesContent":["import pluginQuery from \"@tanstack/eslint-plugin-query\";\nimport type { Linter } from \"eslint\";\nimport reactLint from \"eslint-plugin-react\";\nimport reactCompiler from \"eslint-plugin-react-compiler\";\nimport reactHooks from \"eslint-plugin-react-hooks\";\nimport reactYouMightNotNeedAnEffect from \"eslint-plugin-react-you-might-not-need-an-effect\";\nimport testingLibrary from \"eslint-plugin-testing-library\";\n\nimport { jsxA11y } from \"./plugins.js\";\nimport { excludePackageJsonFromAll } from \"./utils.js\";\n\nexport const react: Linter.Config[] = excludePackageJsonFromAll([\n\t...pluginQuery.configs[\"flat/recommended\"],\n\t{\n\t\t...jsxA11y.flatConfigs.recommended,\n\t\tfiles: [\"**/*.{js,jsx,ts,tsx}\"],\n\t},\n\t{\n\t\tplugins: {\n\t\t\t\"react-compiler\": reactCompiler,\n\t\t},\n\t\trules: {\n\t\t\t\"react-compiler/react-compiler\": \"error\",\n\t\t},\n\t},\n\treactHooks.configs.flat[\"recommended-latest\"],\n\treactYouMightNotNeedAnEffect.configs.recommended,\n\t{\n\t\tfiles: [\"**/*.js\", \"**/*.jsx\", \"**/*.ts\", \"**/*.tsx\"],\n\t\tplugins: {\n\t\t\treact: reactLint,\n\t\t},\n\t\trules: {\n\t\t\t\"react/boolean-prop-naming\": \"warn\",\n\t\t\t\"react/button-has-type\": \"warn\",\n\t\t\t\"react/jsx-max-depth\": [\"warn\", { max: 4 }],\n\t\t\t\"react/jsx-no-target-blank\": \"off\",\n\t\t\t\"react/jsx-no-useless-fragment\": \"warn\",\n\t\t\t\"react/no-unstable-nested-components\": \"warn\",\n\t\t\t\"react/no-unused-prop-types\": \"warn\",\n\t\t\t\"react/react-in-jsx-scope\": \"off\",\n\t\t\t\"sonarjs/jsx-no-leaked-render\": \"off\",\n\t\t},\n\t\tsettings: {\n\t\t\treact: {\n\t\t\t\tversion: \"19.0.0\",\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\t...testingLibrary.configs[\"flat/react\"],\n\t\tfiles: [\n\t\t\t\"tests/**/*.js\",\n\t\t\t\"tests/**/*.jsx\",\n\t\t\t\"tests/**/*.ts\",\n\t\t\t\"tests/**/*.tsx\",\n\t\t],\n\t\trules: {\n\t\t\t\"testing-library/no-node-access\": \"warn\",\n\t\t},\n\t},\n]);\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tailwind.d.ts","sourceRoot":"","sources":["../../../src/eslint/tailwind.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"tailwind.d.ts","sourceRoot":"","sources":["../../../src/eslint/tailwind.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAMrC,MAAM,MAAM,eAAe,GAAG;IAC7B,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,eAAO,MAAM,WAAW,YAAa,eAAe,KAAG,MAAM,CAAC,MAAM,EA+BnE,CAAC"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import path from "path";
|
|
2
2
|
import tailwindcss from "eslint-plugin-tailwindcss";
|
|
3
3
|
import { defineConfig } from "eslint/config";
|
|
4
|
+
import { excludePackageJsonFromAll } from "./utils.js";
|
|
4
5
|
export const getTailwind = (options) => {
|
|
5
6
|
const { twCallees: callees = [], twConfig } = options;
|
|
6
7
|
const config = path.isAbsolute(twConfig) ? twConfig : path.resolve(twConfig);
|
|
7
|
-
return defineConfig([
|
|
8
|
+
return excludePackageJsonFromAll(defineConfig([
|
|
8
9
|
{
|
|
9
10
|
// @ts-expect-error TS2322 Types aren't compatible with exact object types
|
|
10
11
|
extends: [tailwindcss.configs.recommended],
|
|
@@ -29,6 +30,6 @@ export const getTailwind = (options) => {
|
|
|
29
30
|
},
|
|
30
31
|
},
|
|
31
32
|
},
|
|
32
|
-
]);
|
|
33
|
+
]));
|
|
33
34
|
};
|
|
34
35
|
//# sourceMappingURL=tailwind.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tailwind.js","sourceRoot":"","sources":["../../../src/eslint/tailwind.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,WAAW,MAAM,2BAA2B,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"tailwind.js","sourceRoot":"","sources":["../../../src/eslint/tailwind.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,WAAW,MAAM,2BAA2B,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C,OAAO,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC;AAOvD,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,OAAwB,EAAmB,EAAE;IACxE,MAAM,EAAE,SAAS,EAAE,OAAO,GAAG,EAAE,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC;IACtD,MAAM,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC7E,OAAO,yBAAyB,CAC/B,YAAY,CAAC;QACZ;YACC,0EAA0E;YAC1E,OAAO,EAAE,CAAC,WAAW,CAAC,OAAO,CAAC,WAAW,CAAC;YAC1C,0EAA0E;YAC1E,OAAO,EAAE,EAAE,WAAW,EAAE;YACxB,KAAK,EAAE;gBACN,8BAA8B,EAAE,KAAK,EAAE,0BAA0B;gBACjE,iCAAiC,EAAE,MAAM;aACzC;YACD,QAAQ,EAAE;gBACT,WAAW,EAAE;oBACZ,aAAa,EAAE,MAAM;oBACrB,QAAQ,EAAE;wBACT,UAAU;wBACV,kBAAkB;wBAClB,YAAY;wBACZ,QAAQ;wBACR,UAAU;wBACV,WAAW;qBACX;oBACD,SAAS,EAAE,CAAC,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC;iBAC/D;aACD;SACD;KACD,CAAC,CACF,CAAC;AACH,CAAC,CAAC","sourcesContent":["import path from \"path\";\nimport type { Linter } from \"eslint\";\nimport tailwindcss from \"eslint-plugin-tailwindcss\";\nimport { defineConfig } from \"eslint/config\";\n\nimport { excludePackageJsonFromAll } from \"./utils.js\";\n\nexport type TailwindOptions = {\n\ttwCallees?: string[];\n\ttwConfig: string;\n};\n\nexport const getTailwind = (options: TailwindOptions): Linter.Config[] => {\n\tconst { twCallees: callees = [], twConfig } = options;\n\tconst config = path.isAbsolute(twConfig) ? twConfig : path.resolve(twConfig);\n\treturn excludePackageJsonFromAll(\n\t\tdefineConfig([\n\t\t\t{\n\t\t\t\t// @ts-expect-error TS2322 Types aren't compatible with exact object types\n\t\t\t\textends: [tailwindcss.configs.recommended],\n\t\t\t\t// @ts-expect-error TS2322 Types aren't compatible with exact object types\n\t\t\t\tplugins: { tailwindcss },\n\t\t\t\trules: {\n\t\t\t\t\t\"tailwindcss/classnames-order\": \"off\", // Conflicts with prettier\n\t\t\t\t\t\"tailwindcss/no-custom-classname\": \"warn\",\n\t\t\t\t},\n\t\t\t\tsettings: {\n\t\t\t\t\ttailwindcss: {\n\t\t\t\t\t\tcssConfigPath: config,\n\t\t\t\t\t\tcssFiles: [\n\t\t\t\t\t\t\t\"**/*.css\",\n\t\t\t\t\t\t\t\"!**/node_modules\",\n\t\t\t\t\t\t\t\"!**/vendor\",\n\t\t\t\t\t\t\t\"!**/.*\",\n\t\t\t\t\t\t\t\"!**/dist\",\n\t\t\t\t\t\t\t\"!**/build\",\n\t\t\t\t\t\t],\n\t\t\t\t\t\tfunctions: [\"classnames\", \"clsx\", \"ctl\", \"twMerge\", ...callees],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t]),\n\t);\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"turbo.d.ts","sourceRoot":"","sources":["../../../src/eslint/turbo.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"turbo.d.ts","sourceRoot":"","sources":["../../../src/eslint/turbo.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAKrC,eAAO,MAAM,KAAK,EAAE,MAAM,CAAC,MAAM,EAE/B,CAAC"}
|
package/dist/esm/eslint/turbo.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"turbo.js","sourceRoot":"","sources":["../../../src/eslint/turbo.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAE9C,MAAM,CAAC,MAAM,KAAK,GAAoB;
|
|
1
|
+
{"version":3,"file":"turbo.js","sourceRoot":"","sources":["../../../src/eslint/turbo.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAE9C,OAAO,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC;AAEvD,MAAM,CAAC,MAAM,KAAK,GAAoB,yBAAyB,CAAC;IAC/D,OAAO,EAAE,CAAC,kBAAkB,CAAkB;CAC9C,CAAC,CAAC","sourcesContent":["import type { Linter } from \"eslint\";\nimport { configs } from \"eslint-plugin-turbo\";\n\nimport { excludePackageJsonFromAll } from \"./utils.js\";\n\nexport const turbo: Linter.Config[] = excludePackageJsonFromAll([\n\tconfigs?.[\"flat/recommended\"] as Linter.Config,\n]);\n"]}
|
|
@@ -1,4 +1,19 @@
|
|
|
1
1
|
import type { Linter } from "eslint";
|
|
2
|
+
/**
|
|
3
|
+
* Combines any number of ESLint flat configs or config arrays into a single,
|
|
4
|
+
* normalized array: plugin definitions are deduplicated (via
|
|
5
|
+
* {@link deduplicatePlugins}) and any entry without a `files` restriction is
|
|
6
|
+
* excluded from `package.json` (via {@link excludePackageJsonFromAll}).
|
|
7
|
+
*
|
|
8
|
+
* This is the recommended way to assemble an `eslint.config.js`, including
|
|
9
|
+
* appending your own rules on top of a preset — any custom entry you pass in
|
|
10
|
+
* gets the same `package.json` protection as this package's own presets, with
|
|
11
|
+
* nothing extra to remember.
|
|
12
|
+
*
|
|
13
|
+
* @param configs Presets, individual configs, or arrays of either, in any mix.
|
|
14
|
+
* @returns The combined, normalized configuration array.
|
|
15
|
+
*/
|
|
16
|
+
export declare function composeConfig(...configs: (Linter.Config | Linter.Config[])[]): Linter.Config[];
|
|
2
17
|
/**
|
|
3
18
|
* Deduplicates plugins in an ESLint flat configuration array. If multiple
|
|
4
19
|
* configs define the same plugin name with different objects, the first one
|
|
@@ -8,4 +23,25 @@ import type { Linter } from "eslint";
|
|
|
8
23
|
* @returns The deduplicated configuration array.
|
|
9
24
|
*/
|
|
10
25
|
export declare function deduplicatePlugins(configs: Linter.Config[]): Linter.Config[];
|
|
26
|
+
/**
|
|
27
|
+
* Excludes `package.json` from a config entry that has no `files` restriction.
|
|
28
|
+
* Such entries otherwise apply to every file, including `package.json`, which
|
|
29
|
+
* is linted as JSON (via `eslint-package-json`) rather than as JS/TS — running
|
|
30
|
+
* JS/TS-oriented rules against it can crash rules that assume JS-only
|
|
31
|
+
* `SourceCode` APIs (e.g. `getAllComments`).
|
|
32
|
+
*
|
|
33
|
+
* @template T The config entry type.
|
|
34
|
+
* @param config The configuration entry to scope.
|
|
35
|
+
* @returns The same entry, with `package.json` excluded if it wasn't already
|
|
36
|
+
* scoped to specific files.
|
|
37
|
+
*/
|
|
38
|
+
export declare function excludePackageJson<T>(config: T): Pick<Linter.Config, "ignores"> & T;
|
|
39
|
+
/**
|
|
40
|
+
* Applies {@link excludePackageJson} to every entry in a configuration array.
|
|
41
|
+
*
|
|
42
|
+
* @template T The config entry type.
|
|
43
|
+
* @param configs The configuration array to scope.
|
|
44
|
+
* @returns The scoped configuration array.
|
|
45
|
+
*/
|
|
46
|
+
export declare function excludePackageJsonFromAll<T extends Linter.Config>(configs: T[]): (Pick<Linter.Config, "ignores"> & T)[];
|
|
11
47
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/eslint/utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAErC;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,CAoB5E"}
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/eslint/utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAErC;;;;;;;;;;;;;GAaG;AACH,wBAAgB,aAAa,CAC5B,GAAG,OAAO,EAAE,CAAC,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,GAC7C,MAAM,CAAC,MAAM,EAAE,CAEjB;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,CAoB5E;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,EACnC,MAAM,EAAE,CAAC,GACP,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,CAAC,CAUpC;AAED;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAChE,OAAO,EAAE,CAAC,EAAE,GACV,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,CAAC,CAAC,EAAE,CAExC"}
|
package/dist/esm/eslint/utils.js
CHANGED
|
@@ -1,3 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Combines any number of ESLint flat configs or config arrays into a single,
|
|
3
|
+
* normalized array: plugin definitions are deduplicated (via
|
|
4
|
+
* {@link deduplicatePlugins}) and any entry without a `files` restriction is
|
|
5
|
+
* excluded from `package.json` (via {@link excludePackageJsonFromAll}).
|
|
6
|
+
*
|
|
7
|
+
* This is the recommended way to assemble an `eslint.config.js`, including
|
|
8
|
+
* appending your own rules on top of a preset — any custom entry you pass in
|
|
9
|
+
* gets the same `package.json` protection as this package's own presets, with
|
|
10
|
+
* nothing extra to remember.
|
|
11
|
+
*
|
|
12
|
+
* @param configs Presets, individual configs, or arrays of either, in any mix.
|
|
13
|
+
* @returns The combined, normalized configuration array.
|
|
14
|
+
*/
|
|
15
|
+
export function composeConfig(...configs) {
|
|
16
|
+
return excludePackageJsonFromAll(deduplicatePlugins(configs.flat()));
|
|
17
|
+
}
|
|
1
18
|
/**
|
|
2
19
|
* Deduplicates plugins in an ESLint flat configuration array. If multiple
|
|
3
20
|
* configs define the same plugin name with different objects, the first one
|
|
@@ -29,4 +46,37 @@ export function deduplicatePlugins(configs) {
|
|
|
29
46
|
return modified ? { ...config, plugins: newPlugins } : config;
|
|
30
47
|
});
|
|
31
48
|
}
|
|
49
|
+
/**
|
|
50
|
+
* Excludes `package.json` from a config entry that has no `files` restriction.
|
|
51
|
+
* Such entries otherwise apply to every file, including `package.json`, which
|
|
52
|
+
* is linted as JSON (via `eslint-package-json`) rather than as JS/TS — running
|
|
53
|
+
* JS/TS-oriented rules against it can crash rules that assume JS-only
|
|
54
|
+
* `SourceCode` APIs (e.g. `getAllComments`).
|
|
55
|
+
*
|
|
56
|
+
* @template T The config entry type.
|
|
57
|
+
* @param config The configuration entry to scope.
|
|
58
|
+
* @returns The same entry, with `package.json` excluded if it wasn't already
|
|
59
|
+
* scoped to specific files.
|
|
60
|
+
*/
|
|
61
|
+
export function excludePackageJson(config) {
|
|
62
|
+
const entry = config;
|
|
63
|
+
const keys = Object.keys(entry);
|
|
64
|
+
const isGlobalIgnoresOnly = keys.length === 1 && keys[0] === "ignores";
|
|
65
|
+
if (entry.files ?? isGlobalIgnoresOnly)
|
|
66
|
+
return config;
|
|
67
|
+
return {
|
|
68
|
+
...config,
|
|
69
|
+
ignores: [...(entry.ignores ?? []), "**/package.json"],
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Applies {@link excludePackageJson} to every entry in a configuration array.
|
|
74
|
+
*
|
|
75
|
+
* @template T The config entry type.
|
|
76
|
+
* @param configs The configuration array to scope.
|
|
77
|
+
* @returns The scoped configuration array.
|
|
78
|
+
*/
|
|
79
|
+
export function excludePackageJsonFromAll(configs) {
|
|
80
|
+
return configs.map((config) => excludePackageJson(config));
|
|
81
|
+
}
|
|
32
82
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/eslint/utils.ts"],"names":[],"mappings":"AAGA;;;;;;;GAOG;AACH,MAAM,UAAU,kBAAkB,CAAC,OAAwB;IAC1D,MAAM,UAAU,GAAG,IAAI,GAAG,EAAe,CAAC;IAC1C,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;QAC7B,IAAI,CAAC,MAAM,CAAC,OAAO;YAAE,OAAO,MAAM,CAAC;QACnC,MAAM,UAAU,GAAG,EAAE,GAAG,MAAM,CAAC,OAAO,EAAE,CAAC;QACzC,IAAI,QAAQ,GAAG,KAAK,CAAC;QACrB,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,mBAAmB,CAAC,UAAU,CAAC,EAAE,CAAC;YAC3D,MAAM,MAAM,GAAI,UAAkB,CAAC,IAAI,CAAC,CAAC;YACzC,IAAI,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;gBAC1B,MAAM,QAAQ,GAAG,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;gBACtC,IAAI,QAAQ,KAAK,MAAM,EAAE,CAAC;oBACzB,UAAU,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC;oBAC5B,QAAQ,GAAG,IAAI,CAAC;gBACjB,CAAC;YACF,CAAC;iBAAM,CAAC;gBACP,UAAU,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;YAC9B,CAAC;QACF,CAAC;QACD,OAAO,QAAQ,CAAC,CAAC,CAAC,EAAE,GAAG,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC;IAC/D,CAAC,CAAC,CAAC;AACJ,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access */\nimport type { Linter } from \"eslint\";\n\n/**\n * Deduplicates plugins in an ESLint flat configuration array. If multiple\n * configs define the same plugin name with different objects, the first one\n * encountered will be used.\n *\n * @param configs The configuration array to deduplicate.\n * @returns The deduplicated configuration array.\n */\nexport function deduplicatePlugins(configs: Linter.Config[]): Linter.Config[] {\n\tconst pluginsMap = new Map<string, any>();\n\treturn configs.map((config) => {\n\t\tif (!config.plugins) return config;\n\t\tconst newPlugins = { ...config.plugins };\n\t\tlet modified = false;\n\t\tfor (const name of Object.getOwnPropertyNames(newPlugins)) {\n\t\t\tconst plugin = (newPlugins as any)[name];\n\t\t\tif (pluginsMap.has(name)) {\n\t\t\t\tconst existing = pluginsMap.get(name);\n\t\t\t\tif (existing !== plugin) {\n\t\t\t\t\tnewPlugins[name] = existing;\n\t\t\t\t\tmodified = true;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tpluginsMap.set(name, plugin);\n\t\t\t}\n\t\t}\n\t\treturn modified ? { ...config, plugins: newPlugins } : config;\n\t});\n}\n"]}
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/eslint/utils.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,aAAa,CAC5B,GAAG,OAA4C;IAE/C,OAAO,yBAAyB,CAAC,kBAAkB,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;AACtE,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,kBAAkB,CAAC,OAAwB;IAC1D,MAAM,UAAU,GAAG,IAAI,GAAG,EAAe,CAAC;IAC1C,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;QAC7B,IAAI,CAAC,MAAM,CAAC,OAAO;YAAE,OAAO,MAAM,CAAC;QACnC,MAAM,UAAU,GAAG,EAAE,GAAG,MAAM,CAAC,OAAO,EAAE,CAAC;QACzC,IAAI,QAAQ,GAAG,KAAK,CAAC;QACrB,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,mBAAmB,CAAC,UAAU,CAAC,EAAE,CAAC;YAC3D,MAAM,MAAM,GAAI,UAAkB,CAAC,IAAI,CAAC,CAAC;YACzC,IAAI,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;gBAC1B,MAAM,QAAQ,GAAG,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;gBACtC,IAAI,QAAQ,KAAK,MAAM,EAAE,CAAC;oBACzB,UAAU,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC;oBAC5B,QAAQ,GAAG,IAAI,CAAC;gBACjB,CAAC;YACF,CAAC;iBAAM,CAAC;gBACP,UAAU,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;YAC9B,CAAC;QACF,CAAC;QACD,OAAO,QAAQ,CAAC,CAAC,CAAC,EAAE,GAAG,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC;IAC/D,CAAC,CAAC,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,kBAAkB,CACjC,MAAS;IAET,MAAM,KAAK,GAAG,MAAuB,CAAC;IACtC,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAChC,MAAM,mBAAmB,GAAG,IAAI,CAAC,MAAM,KAAK,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC;IACvE,IAAI,KAAK,CAAC,KAAK,IAAI,mBAAmB;QACrC,OAAO,MAA4C,CAAC;IACrD,OAAO;QACN,GAAG,MAAM;QACT,OAAO,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,IAAI,EAAE,CAAC,EAAE,iBAAiB,CAAC;KACtD,CAAC;AACH,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,yBAAyB,CACxC,OAAY;IAEZ,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC,CAAC;AAC5D,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access */\nimport type { Linter } from \"eslint\";\n\n/**\n * Combines any number of ESLint flat configs or config arrays into a single,\n * normalized array: plugin definitions are deduplicated (via\n * {@link deduplicatePlugins}) and any entry without a `files` restriction is\n * excluded from `package.json` (via {@link excludePackageJsonFromAll}).\n *\n * This is the recommended way to assemble an `eslint.config.js`, including\n * appending your own rules on top of a preset — any custom entry you pass in\n * gets the same `package.json` protection as this package's own presets, with\n * nothing extra to remember.\n *\n * @param configs Presets, individual configs, or arrays of either, in any mix.\n * @returns The combined, normalized configuration array.\n */\nexport function composeConfig(\n\t...configs: (Linter.Config | Linter.Config[])[]\n): Linter.Config[] {\n\treturn excludePackageJsonFromAll(deduplicatePlugins(configs.flat()));\n}\n\n/**\n * Deduplicates plugins in an ESLint flat configuration array. If multiple\n * configs define the same plugin name with different objects, the first one\n * encountered will be used.\n *\n * @param configs The configuration array to deduplicate.\n * @returns The deduplicated configuration array.\n */\nexport function deduplicatePlugins(configs: Linter.Config[]): Linter.Config[] {\n\tconst pluginsMap = new Map<string, any>();\n\treturn configs.map((config) => {\n\t\tif (!config.plugins) return config;\n\t\tconst newPlugins = { ...config.plugins };\n\t\tlet modified = false;\n\t\tfor (const name of Object.getOwnPropertyNames(newPlugins)) {\n\t\t\tconst plugin = (newPlugins as any)[name];\n\t\t\tif (pluginsMap.has(name)) {\n\t\t\t\tconst existing = pluginsMap.get(name);\n\t\t\t\tif (existing !== plugin) {\n\t\t\t\t\tnewPlugins[name] = existing;\n\t\t\t\t\tmodified = true;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tpluginsMap.set(name, plugin);\n\t\t\t}\n\t\t}\n\t\treturn modified ? { ...config, plugins: newPlugins } : config;\n\t});\n}\n\n/**\n * Excludes `package.json` from a config entry that has no `files` restriction.\n * Such entries otherwise apply to every file, including `package.json`, which\n * is linted as JSON (via `eslint-package-json`) rather than as JS/TS — running\n * JS/TS-oriented rules against it can crash rules that assume JS-only\n * `SourceCode` APIs (e.g. `getAllComments`).\n *\n * @template T The config entry type.\n * @param config The configuration entry to scope.\n * @returns The same entry, with `package.json` excluded if it wasn't already\n * scoped to specific files.\n */\nexport function excludePackageJson<T>(\n\tconfig: T,\n): Pick<Linter.Config, \"ignores\"> & T {\n\tconst entry = config as Linter.Config;\n\tconst keys = Object.keys(entry);\n\tconst isGlobalIgnoresOnly = keys.length === 1 && keys[0] === \"ignores\";\n\tif (entry.files ?? isGlobalIgnoresOnly)\n\t\treturn config as Pick<Linter.Config, \"ignores\"> & T;\n\treturn {\n\t\t...config,\n\t\tignores: [...(entry.ignores ?? []), \"**/package.json\"],\n\t};\n}\n\n/**\n * Applies {@link excludePackageJson} to every entry in a configuration array.\n *\n * @template T The config entry type.\n * @param configs The configuration array to scope.\n * @returns The scoped configuration array.\n */\nexport function excludePackageJsonFromAll<T extends Linter.Config>(\n\tconfigs: T[],\n): (Pick<Linter.Config, \"ignores\"> & T)[] {\n\treturn configs.map((config) => excludePackageJson(config));\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lintStaged.d.ts","sourceRoot":"","sources":["../../src/lintStaged.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"lintStaged.d.ts","sourceRoot":"","sources":["../../src/lintStaged.ts"],"names":[],"mappings":"AAgBA;;;;GAIG;AACH,wBAAgB,aAAa,IAAI,MAAM,CAYtC;AAsBD,QAAA,MAAM,QAAQ;IACb,GAAG;IACH,MAAM;IACN,GAAG;IACH,SAAS;IACT,SAAS;CACT,CAAC;AAEF,QAAA,MAAM,KAAK;;QAET,CAAC,QAAQ,CAAC,GAAG,CAAC,WAA+C;QAC7D,CAAC,QAAQ,CAAC,GAAG,CAAC,WAGb;;;QAGD,CAAC,QAAQ,CAAC,MAAM,CAAC,WAA0B;QAC3C,CAAC,QAAQ,CAAC,SAAS,CAAC,WAA6B;QACjD,CAAC,QAAQ,CAAC,SAAS,CAAC,WAA0B;;CAE/C,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,WAAW,IAAI,OAAO,CAQrC;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,IAAI,MAAM,OAAO,KAAK,CAExE;AAYD,eAAO,MAAM,cAAc;IAhDzB,CAAC,QAAQ,CAAC,GAAG,CAAC,WAA+C;IAC7D,CAAC,QAAQ,CAAC,GAAG,CAAC,WAGb;CA4CiC,CAAC"}
|
package/dist/esm/lintStaged.js
CHANGED
|
@@ -1,34 +1,56 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { statSync } from "fs";
|
|
1
|
+
import { spawnSync } from "child_process";
|
|
2
|
+
import { accessSync, constants, statSync } from "fs";
|
|
3
3
|
import path from "path";
|
|
4
4
|
import { safeishGetProperty } from "@rootreeweb/js-lib";
|
|
5
|
+
/** Fixed directories searched to resolve executables, bypassing `$PATH`. */
|
|
6
|
+
const trustedBinDirs = [
|
|
7
|
+
"/usr/local/bin",
|
|
8
|
+
"/usr/bin",
|
|
9
|
+
"/bin",
|
|
10
|
+
"/opt/homebrew/bin",
|
|
11
|
+
path.dirname(process.execPath),
|
|
12
|
+
path.resolve("node_modules", ".bin"),
|
|
13
|
+
];
|
|
5
14
|
/**
|
|
6
15
|
* Gets the name of the currently checked-out git branch.
|
|
7
16
|
*
|
|
8
17
|
* @returns The branch name.
|
|
9
18
|
*/
|
|
10
19
|
export function getBranchName() {
|
|
11
|
-
|
|
12
|
-
|
|
20
|
+
const git = resolveBinary("git");
|
|
21
|
+
if (!git)
|
|
22
|
+
return "none";
|
|
13
23
|
try {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
const repoCheck = spawnSync("git", [
|
|
20
|
-
"rev-parse",
|
|
21
|
-
"--is-inside-work-tree",
|
|
22
|
-
]);
|
|
23
|
-
isRepo = repoCheck.status === 0;
|
|
24
|
-
}
|
|
24
|
+
const repoCheck = spawnSync(git, ["rev-parse", "--is-inside-work-tree"]);
|
|
25
|
+
if (repoCheck.status !== 0)
|
|
26
|
+
return "none";
|
|
27
|
+
const branch = spawnSync(git, ["rev-parse", "--abbrev-ref", "HEAD"]);
|
|
28
|
+
return branch.status === 0 ? branch.stdout.toString().trim() : "none";
|
|
25
29
|
}
|
|
26
30
|
catch (e) {
|
|
27
|
-
console.error("Not a repository or git not available", e);
|
|
28
|
-
}
|
|
29
|
-
if (!hasGit || !isRepo)
|
|
31
|
+
console.error("Not a repository or git not available", e);
|
|
30
32
|
return "none";
|
|
31
|
-
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Resolves an executable to an absolute path within a fixed set of trusted
|
|
37
|
+
* directories, ignoring `$PATH`.
|
|
38
|
+
*
|
|
39
|
+
* @param command The executable name to resolve.
|
|
40
|
+
* @returns The absolute path, or `null` if not found in a trusted directory.
|
|
41
|
+
*/
|
|
42
|
+
function resolveBinary(command) {
|
|
43
|
+
for (const dir of trustedBinDirs) {
|
|
44
|
+
const candidate = path.join(dir, command);
|
|
45
|
+
try {
|
|
46
|
+
accessSync(candidate, constants.X_OK);
|
|
47
|
+
return candidate;
|
|
48
|
+
}
|
|
49
|
+
catch {
|
|
50
|
+
// Not executable here; try the next trusted directory.
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return null;
|
|
32
54
|
}
|
|
33
55
|
const patterns = {
|
|
34
56
|
all: "*",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lintStaged.js","sourceRoot":"","sources":["../../src/lintStaged.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"lintStaged.js","sourceRoot":"","sources":["../../src/lintStaged.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC;AACrD,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAExD,4EAA4E;AAC5E,MAAM,cAAc,GAAG;IACtB,gBAAgB;IAChB,UAAU;IACV,MAAM;IACN,mBAAm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QAAQ,CAAC,SAAS,IAAI,MAAM,EAAE,CAAC;IACpD,2BAA2B;IAC3B,OAAO,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;AACnC,CAAC;AACD,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC","sourcesContent":["import { spawnSync } from \"child_process\";\nimport { accessSync, constants, statSync } from \"fs\";\nimport path from \"path\";\n\nimport { safeishGetProperty } from \"@rootreeweb/js-lib\";\n\n/** Fixed directories searched to resolve executables, bypassing `$PATH`. */\nconst trustedBinDirs = [\n\t\"/usr/local/bin\",\n\t\"/usr/bin\",\n\t\"/bin\",\n\t\"/opt/homebrew/bin\",\n\tpath.dirname(process.execPath),\n\tpath.resolve(\"node_modules\", \".bin\"),\n];\n\n/**\n * Gets the name of the currently checked-out git branch.\n *\n * @returns The branch name.\n */\nexport function getBranchName(): string {\n\tconst git = resolveBinary(\"git\");\n\tif (!git) return \"none\";\n\ttry {\n\t\tconst repoCheck = spawnSync(git, [\"rev-parse\", \"--is-inside-work-tree\"]);\n\t\tif (repoCheck.status !== 0) return \"none\";\n\t\tconst branch = spawnSync(git, [\"rev-parse\", \"--abbrev-ref\", \"HEAD\"]);\n\t\treturn branch.status === 0 ? branch.stdout.toString().trim() : \"none\";\n\t} catch (e) {\n\t\tconsole.error(\"Not a repository or git not available\", e);\n\t\treturn \"none\";\n\t}\n}\n\n/**\n * Resolves an executable to an absolute path within a fixed set of trusted\n * directories, ignoring `$PATH`.\n *\n * @param command The executable name to resolve.\n * @returns The absolute path, or `null` if not found in a trusted directory.\n */\nfunction resolveBinary(command: string): null | string {\n\tfor (const dir of trustedBinDirs) {\n\t\tconst candidate = path.join(dir, command);\n\t\ttry {\n\t\t\taccessSync(candidate, constants.X_OK);\n\t\t\treturn candidate;\n\t\t} catch {\n\t\t\t// Not executable here; try the next trusted directory.\n\t\t}\n\t}\n\treturn null;\n}\n\nconst patterns = {\n\tall: \"*\",\n\teslint: \"*.{js,ts,jsx,tsx,cjs,mjs,astro}\",\n\tphp: \"*.php\",\n\tstylelint: \"*.{css,scss}\",\n\ttypeCheck: \"*.{ts,tsx,json,astro}\",\n};\n\nconst tasks = {\n\tall: {\n\t\t[patterns.all]: [\"prettier --ignore-unknown --write --cache\"],\n\t\t[patterns.php]: [\n\t\t\t\"./vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php\",\n\t\t\t\"./vendor/bin/phpcbf --standard=phpcs.xml -d error_reporting=24575\",\n\t\t],\n\t},\n\tmain: {\n\t\t[patterns.eslint]: [\"eslint --fix --cache\"],\n\t\t[patterns.stylelint]: [\"stylelint --fix --cache\"],\n\t\t[patterns.typeCheck]: [\"sh -c 'tsc --noEmit'\"],\n\t},\n};\n\n/**\n * Determines if a tsconfig file is present.\n *\n * @returns True if a tsconfig.json is present.\n */\nexport function hasTsconfig(): boolean {\n\ttry {\n\t\tconst result = statSync(path.resolve(\"tsconfig.json\"));\n\t\treturn result.isFile();\n\t\t// eslint-disable-next-line sonarjs/no-ignored-exceptions\n\t} catch (_) {\n\t\treturn false;\n\t}\n}\n\n/**\n * Checks if there are tasks for the given branch\n *\n * @param name The name of the branch to check\n * @returns True if the branch has rules defined.\n */\nexport function isDefinedBranch(name: string): name is keyof typeof tasks {\n\treturn name in tasks;\n}\n\nconst branch = getBranchName();\n\nconst output = tasks.all;\nif (isDefinedBranch(branch)) {\n\tObject.assign(output, safeishGetProperty(tasks, branch));\n}\nif (!hasTsconfig() && patterns.typeCheck in output) {\n\t// eslint-disable-next-line\n\tdelete output[patterns.typeCheck];\n}\nexport const lintStagedBase = output;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prettier.d.ts","sourceRoot":"","sources":["../../src/prettier.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"prettier.d.ts","sourceRoot":"","sources":["../../src/prettier.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAO/C,eAAO,MAAM,QAAQ,EAAE,MAatB,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG;IAAE,SAAS,CAAC,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC;AAE/D;;;;;GAKG;AACH,wBAAgB,aAAa,CAC5B,GAAG,MAAM,EAAE,UAAU,CAAC,OAAO,gBAAgB,CAAC,GAC5C,MAAM,CAeR;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,gBAAgB,CAC/B,kBAAkB,EAAE,MAAM,EAC1B,OAAO,CAAC,EAAE,uBAAuB,GAC/B,MAAM,GAAG;IAAE,OAAO,EAAE,MAAM,EAAE,CAAA;CAAE,CAQhC"}
|
package/dist/esm/prettier.js
CHANGED
package/dist/esm/prettier.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prettier.js","sourceRoot":"","sources":["../../src/prettier.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,GAAmC;IAC/C,
|
|
1
|
+
{"version":3,"file":"prettier.js","sourceRoot":"","sources":["../../src/prettier.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,GAAmC;IAC/C,qCAAqC;IACrC,uBAAuB;CACvB,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAW;IAC/B,WAAW,EAAE;QACZ,mBAAmB;QACnB,uBAAuB;QACvB,EAAE;QACF,oBAAoB;QACpB,EAAE;QACF,UAAU;QACV,QAAQ;QACR,OAAO;KACP;IACD,OAAO;IACP,OAAO,EAAE,IAAI;CACb,CAAC;AAIF;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CAC5B,GAAG,MAA2C;IAE9C,MAAM,IAAI,GAAG,gBAAgB,CAAC,GAAG,MAAM,CAAC,CAAC;IACzC,OAAO;QACN,GAAG,IAAI;QACP,SAAS,EAAE;YACV,GAAG,CAAC,IAAI,CAAC,SAAS,IAAI,EAAE,CAAC;YACzB;gBACC,KAAK,EAAE,SAAS;gBAChB,OAAO,EAAE;oBACR,MAAM,EAAE,OAAO;iBACf;aACD;SACD;QACD,OAAO,EAAE,CAAC,uBAAuB,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC;KACnD,CAAC;AACH,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,gBAAgB,CAC/B,kBAA0B,EAC1B,OAAiC;IAEjC,OAAO;QACN,GAAG,QAAQ;QACX,OAAO,EAAE,CAAC,GAAG,OAAO,EAAE,6BAA6B,CAAC;QACpD,iBAAiB,EAAE,CAAC,SAAS,EAAE,GAAG,CAAC,OAAO,EAAE,SAAS,IAAI,EAAE,CAAC,CAAC;QAE7D,kBAAkB;KAClB,CAAC;AACH,CAAC","sourcesContent":["import type { Config, Plugin } from \"prettier\";\n\nconst plugins: NonNullable<Config[\"plugins\"]> = [\n\t\"@ianvs/prettier-plugin-sort-imports\",\n\t\"prettier-plugin-jsdoc\",\n];\n\nexport const prettier: Config = {\n\timportOrder: [\n\t\t\"<BUILTIN_MODULES>\",\n\t\t\"<THIRD_PARTY_MODULES>\",\n\t\t\"\",\n\t\t\"^@rootreeweb/(.*)$\",\n\t\t\"\",\n\t\t\"^@/(.*)$\",\n\t\t\"^[../]\",\n\t\t\"^[./]\",\n\t],\n\tplugins,\n\tuseTabs: true,\n};\n\nexport type PrettierTailwindOptions = { functions?: string[] };\n\n/**\n * Provides a prettier config for Astro projects.\n *\n * @param params The tailwindcss info.\n * @returns The configuration.\n */\nexport function prettierAstro(\n\t...params: Parameters<typeof prettierTailwind>\n): Config {\n\tconst base = prettierTailwind(...params);\n\treturn {\n\t\t...base,\n\t\toverrides: [\n\t\t\t...(base.overrides ?? []),\n\t\t\t{\n\t\t\t\tfiles: \"*.astro\",\n\t\t\t\toptions: {\n\t\t\t\t\tparser: \"astro\",\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t\tplugins: [\"prettier-plugin-astro\", ...base.plugins],\n\t};\n}\n\n/**\n * Creates a prettier configuration for tailwind.\n *\n * @example\n * \timport { prettierTailwind } from \"@rootreeweb/linting\";\n *\n * \texport default prettierTailwind(\"./src/app/globals.css\");\n *\n * @param tailwindStylesheet The path to the stylesheet that imports Tailwind.\n * @param options Additional options for generating the configuration.\n * @returns The configuration.\n */\nexport function prettierTailwind(\n\ttailwindStylesheet: string,\n\toptions?: PrettierTailwindOptions,\n): Config & { plugins: Plugin[] } {\n\treturn {\n\t\t...prettier,\n\t\tplugins: [...plugins, \"prettier-plugin-tailwindcss\"],\n\t\ttailwindFunctions: [\"twMerge\", ...(options?.functions ?? [])],\n\n\t\ttailwindStylesheet,\n\t};\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"basic.d.ts","sourceRoot":"","sources":["../../../src/stylelint/basic.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"basic.d.ts","sourceRoot":"","sources":["../../../src/stylelint/basic.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAKxC,eAAO,MAAM,SAAS,EAAE,MAAM,GAAG;IAAE,OAAO,EAAE,MAAM,EAAE,CAAA;CAiBnD,CAAC"}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
import { fileURLToPath } from "node:url";
|
|
2
|
+
const resolveStylelintConfig = (specifier) => fileURLToPath(import.meta.resolve(specifier));
|
|
2
3
|
export const stylelint = {
|
|
3
|
-
extends: [
|
|
4
|
+
extends: [
|
|
5
|
+
resolveStylelintConfig("stylelint-config-standard-scss"),
|
|
6
|
+
resolveStylelintConfig("stylelint-prettier/recommended"),
|
|
7
|
+
],
|
|
4
8
|
rules: {
|
|
5
9
|
"at-rule-no-deprecated": null,
|
|
6
10
|
"at-rule-no-unknown": null,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"basic.js","sourceRoot":"","sources":["../../../src/stylelint/basic.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"basic.js","sourceRoot":"","sources":["../../../src/stylelint/basic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAGzC,MAAM,sBAAsB,GAAG,CAAC,SAAiB,EAAU,EAAE,CAC5D,aAAa,CAAC,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC;AAE/C,MAAM,CAAC,MAAM,SAAS,GAAmC;IACxD,OAAO,EAAE;QACR,sBAAsB,CAAC,gCAAgC,CAAC;QACxD,sBAAsB,CAAC,gCAAgC,CAAC;KACxD;IACD,KAAK,EAAE;QACN,uBAAuB,EAAE,IAAI;QAC7B,oBAAoB,EAAE,IAAI;QAC1B,0BAA0B,EAAE,CAAC,IAAI,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;QAC3D,2BAA2B,EAAE;YAC5B,IAAI;YACJ,EAAE,MAAM,EAAE,CAAC,uBAAuB,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE;SAC1D;QACD,yBAAyB,EAAE,CAAC,IAAI,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;QAC1D,gCAAgC,EAAE,IAAI;QACtC,wBAAwB,EAAE,mBAAmB;KAC7C;CACD,CAAC","sourcesContent":["import { fileURLToPath } from \"node:url\";\nimport type { Config } from \"stylelint\";\n\nconst resolveStylelintConfig = (specifier: string): string =>\n\tfileURLToPath(import.meta.resolve(specifier));\n\nexport const stylelint: Config & { extends: string[] } = {\n\textends: [\n\t\tresolveStylelintConfig(\"stylelint-config-standard-scss\"),\n\t\tresolveStylelintConfig(\"stylelint-prettier/recommended\"),\n\t],\n\trules: {\n\t\t\"at-rule-no-deprecated\": null,\n\t\t\"at-rule-no-unknown\": null,\n\t\t\"declaration-no-important\": [true, { severity: \"warning\" }],\n\t\t\"no-descending-specificity\": [\n\t\t\ttrue,\n\t\t\t{ ignore: [\"selectors-within-list\"], severity: \"warning\" },\n\t\t],\n\t\t\"scss/at-rule-no-unknown\": [true, { severity: \"warning\" }],\n\t\t\"scss/operator-no-newline-after\": null,\n\t\t\"selector-class-pattern\": \"[a-z][\\\\d\\\\w]{3,}\",\n\t},\n};\n"]}
|
package/package.json
CHANGED
|
@@ -1,30 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rootreeweb/linting",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0",
|
|
4
4
|
"description": "Shared configurations for ESLint and Stylelint",
|
|
5
|
-
"
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
},
|
|
9
|
-
"license": "",
|
|
10
|
-
"author": {
|
|
11
|
-
"name": "Rootree Web",
|
|
12
|
-
"email": "web@rootree.ca"
|
|
13
|
-
},
|
|
14
|
-
"sideEffects": false,
|
|
5
|
+
"license": "UNLICENSED",
|
|
6
|
+
"repository": "github:rootreeweb/meta-tools",
|
|
7
|
+
"author": "Rootree Web <web@rootree.ca>",
|
|
15
8
|
"type": "module",
|
|
16
9
|
"exports": {
|
|
17
10
|
".": {
|
|
11
|
+
"types": "./dist/esm/index.d.ts",
|
|
18
12
|
"import": {
|
|
19
13
|
"types": "./dist/esm/index.d.ts",
|
|
20
14
|
"default": "./dist/esm/index.js"
|
|
21
|
-
}
|
|
15
|
+
},
|
|
16
|
+
"default": "./dist/esm/index.js"
|
|
22
17
|
}
|
|
23
18
|
},
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
|
|
19
|
+
"sideEffects": false,
|
|
20
|
+
"engines": {
|
|
21
|
+
"node": ">=22"
|
|
22
|
+
},
|
|
28
23
|
"scripts": {
|
|
29
24
|
"build": "yarn run clean && yarn run build:esm",
|
|
30
25
|
"build:esm": "tsgo -p ./configs/tsconfig.esm.json",
|
|
@@ -37,6 +32,16 @@
|
|
|
37
32
|
"test": "vitest run --coverage",
|
|
38
33
|
"test:watch": "vitest --coverage --ui"
|
|
39
34
|
},
|
|
35
|
+
"files": [
|
|
36
|
+
"dist/**/*"
|
|
37
|
+
],
|
|
38
|
+
"keywords": [
|
|
39
|
+
"eslint",
|
|
40
|
+
"eslint-config",
|
|
41
|
+
"lint",
|
|
42
|
+
"stylelint",
|
|
43
|
+
"stylelint-config"
|
|
44
|
+
],
|
|
40
45
|
"dependencies": {
|
|
41
46
|
"@eslint/js": "^10.0.1",
|
|
42
47
|
"@ianvs/prettier-plugin-sort-imports": "^4.7.1",
|
|
@@ -45,63 +50,69 @@
|
|
|
45
50
|
"@tanstack/eslint-plugin-query": "^5.101.4",
|
|
46
51
|
"@vitest/eslint-plugin": "^1.6.24",
|
|
47
52
|
"eslint-import-resolver-typescript": "^4.4.5",
|
|
53
|
+
"eslint-package-json": "^0.3.0",
|
|
48
54
|
"eslint-plugin-astro": "^3.0.1",
|
|
49
55
|
"eslint-plugin-import": "^2.32.0",
|
|
50
|
-
"eslint-plugin-jsdoc": "^63.3.
|
|
56
|
+
"eslint-plugin-jsdoc": "^63.3.2",
|
|
51
57
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
52
58
|
"eslint-plugin-perfectionist": "^5.10.0",
|
|
53
59
|
"eslint-plugin-promise": "^7.3.0",
|
|
54
60
|
"eslint-plugin-react": "^7.37.5",
|
|
55
|
-
"eslint-plugin-react-compiler": "19.1.0-rc.2",
|
|
61
|
+
"eslint-plugin-react-compiler": "^19.1.0-rc.2",
|
|
56
62
|
"eslint-plugin-react-hooks": "^7.1.1",
|
|
57
63
|
"eslint-plugin-react-you-might-not-need-an-effect": "^1.0.1",
|
|
58
64
|
"eslint-plugin-security": "^4.0.1",
|
|
59
65
|
"eslint-plugin-sonarjs": "^4.2.0",
|
|
60
66
|
"eslint-plugin-tailwindcss": "^4.2.0",
|
|
61
67
|
"eslint-plugin-testing-library": "^7.16.2",
|
|
62
|
-
"eslint-plugin-turbo": "^2.10.
|
|
68
|
+
"eslint-plugin-turbo": "^2.10.8",
|
|
63
69
|
"globals": "^17.8.0",
|
|
64
|
-
"postcss": "^8.5.
|
|
70
|
+
"postcss": "^8.5.25",
|
|
65
71
|
"prettier-plugin-astro": "^0.14.1",
|
|
66
72
|
"prettier-plugin-jsdoc": "^1.8.1",
|
|
67
|
-
"prettier-plugin-packagejson": "^3.0.2",
|
|
68
73
|
"prettier-plugin-tailwindcss": "^0.8.1",
|
|
69
|
-
"stylelint-config-standard": "40.0.0",
|
|
70
|
-
"stylelint-config-standard-scss": "17.0.0",
|
|
71
|
-
"stylelint-config-tailwindcss": "1.0.1",
|
|
72
|
-
"stylelint-prettier": "5.0.3",
|
|
74
|
+
"stylelint-config-standard": "^40.0.0",
|
|
75
|
+
"stylelint-config-standard-scss": "^17.0.0",
|
|
76
|
+
"stylelint-config-tailwindcss": "^1.0.1",
|
|
77
|
+
"stylelint-prettier": "^5.0.3",
|
|
73
78
|
"tailwindcss": "^4.3.3",
|
|
74
79
|
"typescript-eslint": "^8.65.0"
|
|
75
80
|
},
|
|
76
81
|
"devDependencies": {
|
|
77
|
-
"@rootreeweb/tsconfigs": "3.3.16",
|
|
82
|
+
"@rootreeweb/tsconfigs": "^3.3.16",
|
|
78
83
|
"@types/eslint-plugin-jsx-a11y": "^6.10.1",
|
|
79
84
|
"@types/eslint-plugin-security": "^3.0.1",
|
|
80
85
|
"@types/node": "^26.1.2",
|
|
81
|
-
"@types/react": "^19.2.
|
|
86
|
+
"@types/react": "^19.2.18",
|
|
82
87
|
"@typescript/native-preview": "^7.0.0-dev.20260707.2",
|
|
83
88
|
"@vitest/coverage-v8": "^4.1.10",
|
|
84
|
-
"@vitest/ui": "4.1.10",
|
|
89
|
+
"@vitest/ui": "^4.1.10",
|
|
85
90
|
"del-cli": "^7.0.0",
|
|
86
91
|
"eslint": "^10.8.0",
|
|
87
92
|
"husky": "^9.1.7",
|
|
88
|
-
"knip": "^6.
|
|
89
|
-
"lint-staged": "^17.
|
|
93
|
+
"knip": "^6.31.0",
|
|
94
|
+
"lint-staged": "^17.3.0",
|
|
90
95
|
"prettier": "~3.8.5",
|
|
91
96
|
"react": "^19.2.8",
|
|
92
97
|
"stylelint": "~17.14.1",
|
|
93
|
-
"turbo": "~2.10.
|
|
98
|
+
"turbo": "~2.10.8",
|
|
94
99
|
"typescript": "^6.0.3",
|
|
95
100
|
"vitest": "^4.1.10"
|
|
96
101
|
},
|
|
97
102
|
"peerDependencies": {
|
|
98
103
|
"eslint": "^10",
|
|
99
|
-
"husky": "
|
|
100
|
-
"lint-staged": "
|
|
101
|
-
"prettier": "~3.8.0"
|
|
102
|
-
},
|
|
103
|
-
"optionalDependencies": {
|
|
104
|
+
"husky": "^9.1.7",
|
|
105
|
+
"lint-staged": "^17.2.0",
|
|
106
|
+
"prettier": "~3.8.0",
|
|
104
107
|
"stylelint": "~17.14.1",
|
|
105
108
|
"turbo": "~2.10.7"
|
|
109
|
+
},
|
|
110
|
+
"peerDependenciesMeta": {
|
|
111
|
+
"stylelint": {
|
|
112
|
+
"optional": true
|
|
113
|
+
},
|
|
114
|
+
"turbo": {
|
|
115
|
+
"optional": true
|
|
116
|
+
}
|
|
106
117
|
}
|
|
107
118
|
}
|