@rootreeweb/linting 4.2.5 → 4.2.7

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.
@@ -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;AAqCrC,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
+ {"version":3,"file":"tailwind.d.ts","sourceRoot":"","sources":["../../../src/eslint/tailwind.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAIrC,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,EA6BnE,CAAC"}
@@ -1,58 +1,22 @@
1
1
  import path from "path";
2
- import tailwindLint from "eslint-plugin-tailwindcss";
3
- /**
4
- * Patch eslint-plugin-tailwindcss rules that call `context.getSourceCode()`,
5
- * which was removed in ESLint 10 in favor of `context.sourceCode`. Affected
6
- * rules: enforces-shorthand, classnames-order, migration-from-tailwind-2.
7
- */
8
- const rulesToPatch = [
9
- "enforces-shorthand",
10
- "classnames-order",
11
- "migration-from-tailwind-2",
12
- ];
13
- const rules = tailwindLint.rules;
14
- if (rules) {
15
- for (const ruleName of rulesToPatch) {
16
- const rule = rules[ruleName];
17
- if (!rule)
18
- continue;
19
- // eslint-disable-next-line @typescript-eslint/unbound-method
20
- const originalCreate = rule.create;
21
- rule.create = function (context) {
22
- if (!context.getSourceCode && context.sourceCode) {
23
- const patchedContext = new Proxy(context, {
24
- get(target, prop) {
25
- if (prop === "getSourceCode") {
26
- return () => target.sourceCode;
27
- }
28
- return target[prop];
29
- },
30
- });
31
- return originalCreate(patchedContext);
32
- }
33
- return originalCreate(context);
34
- };
35
- }
36
- }
2
+ import tailwindcss from "eslint-plugin-tailwindcss";
3
+ import { defineConfig } from "eslint/config";
37
4
  export const getTailwind = (options) => {
38
5
  const { twCallees: callees = [], twConfig } = options;
39
6
  const config = path.isAbsolute(twConfig) ? twConfig : path.resolve(twConfig);
40
- return [
41
- ...tailwindLint.configs["flat/recommended"],
7
+ return defineConfig([
42
8
  {
9
+ // @ts-expect-error TS2322 Types aren't compatible with exact object types
10
+ extends: [tailwindcss.configs.recommended],
11
+ // @ts-expect-error TS2322 Types aren't compatible with exact object types
12
+ plugins: { tailwindcss },
43
13
  rules: {
44
14
  "tailwindcss/classnames-order": "off", // Conflicts with prettier
45
- "tailwindcss/no-custom-classname": [
46
- "warn",
47
- {
48
- callees: ["twMerge", ...callees],
49
- },
50
- ],
15
+ "tailwindcss/no-custom-classname": "warn",
51
16
  },
52
17
  settings: {
53
18
  tailwindcss: {
54
- callees: ["classnames", "clsx", "ctl", "twMerge", ...callees],
55
- config,
19
+ cssConfigPath: config,
56
20
  cssFiles: [
57
21
  "**/*.css",
58
22
  "!**/node_modules",
@@ -61,9 +25,10 @@ export const getTailwind = (options) => {
61
25
  "!**/dist",
62
26
  "!**/build",
63
27
  ],
28
+ functions: ["classnames", "clsx", "ctl", "twMerge", ...callees],
64
29
  },
65
30
  },
66
31
  },
67
- ];
32
+ ]);
68
33
  };
69
34
  //# 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,YAAY,MAAM,2BAA2B,CAAC;AAErD;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OAAO,CAAC,kBAAkB,CAAC;QAC3C;YACC,KAAK,EAAE;gBACN,8BAA8B,EAAE,KAAK,EAAE,0BAA0B;gBACjE,iCAAiC,EAAE;oBAClC,MAAM;oBACN;wBACC,OAAO,EAAE,CAAC,SAAS,EAAE,GAAG,OAAO,CAAC;qBAChC;iBACD;aACD;YACD,QAAQ,EAAE;gBACT,WAAW,EAAE;oBACZ,OAAO,EAAE,CAAC,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC;oBAC7D,MAAM;oBACN,QAAQ,EAAE;wBACT,UAAU;wBACV,kBAAkB;wBAClB,YAAY;wBACZ,QAAQ;wBACR,UAAU;wBACV,WAAW;qBACX;iBACD;aACD;SACD;KACD,CAAC;AACH,CAAC,CAAC","sourcesContent":["import path from \"path\";\nimport type { Linter } from \"eslint\";\nimport tailwindLint from \"eslint-plugin-tailwindcss\";\n\n/**\n * Patch eslint-plugin-tailwindcss rules that call `context.getSourceCode()`,\n * which was removed in ESLint 10 in favor of `context.sourceCode`. Affected\n * rules: enforces-shorthand, classnames-order, migration-from-tailwind-2.\n */\nconst rulesToPatch = [\n\t\"enforces-shorthand\",\n\t\"classnames-order\",\n\t\"migration-from-tailwind-2\",\n] as const;\n\nconst rules = tailwindLint.rules;\nif (rules) {\n\tfor (const ruleName of rulesToPatch) {\n\t\tconst rule = rules[ruleName];\n\t\tif (!rule) continue;\n\t\t// eslint-disable-next-line @typescript-eslint/unbound-method\n\t\tconst originalCreate = rule.create;\n\t\trule.create = function (context: any) {\n\t\t\tif (!context.getSourceCode && context.sourceCode) {\n\t\t\t\tconst patchedContext = new Proxy(context, {\n\t\t\t\t\tget(target, prop) {\n\t\t\t\t\t\tif (prop === \"getSourceCode\") {\n\t\t\t\t\t\t\treturn () => target.sourceCode;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn target[prop as keyof typeof target];\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t\treturn originalCreate(patchedContext);\n\t\t\t}\n\t\t\treturn originalCreate(context);\n\t\t};\n\t}\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 [\n\t\t...tailwindLint.configs[\"flat/recommended\"],\n\t\t{\n\t\t\trules: {\n\t\t\t\t\"tailwindcss/classnames-order\": \"off\", // Conflicts with prettier\n\t\t\t\t\"tailwindcss/no-custom-classname\": [\n\t\t\t\t\t\"warn\",\n\t\t\t\t\t{\n\t\t\t\t\t\tcallees: [\"twMerge\", ...callees],\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t\tsettings: {\n\t\t\t\ttailwindcss: {\n\t\t\t\t\tcallees: [\"classnames\", \"clsx\", \"ctl\", \"twMerge\", ...callees],\n\t\t\t\t\tconfig,\n\t\t\t\t\tcssFiles: [\n\t\t\t\t\t\t\"**/*.css\",\n\t\t\t\t\t\t\"!**/node_modules\",\n\t\t\t\t\t\t\"!**/vendor\",\n\t\t\t\t\t\t\"!**/.*\",\n\t\t\t\t\t\t\"!**/dist\",\n\t\t\t\t\t\t\"!**/build\",\n\t\t\t\t\t],\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t];\n};\n"]}
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;AAO7C,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,YAAY,CAAC;QACnB;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,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import path from \"path\";\nimport type { Linter } from \"eslint\";\nimport tailwindcss from \"eslint-plugin-tailwindcss\";\nimport { defineConfig } from \"eslint/config\";\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 defineConfig([\n\t\t{\n\t\t\t// @ts-expect-error TS2322 Types aren't compatible with exact object types\n\t\t\textends: [tailwindcss.configs.recommended],\n\t\t\t// @ts-expect-error TS2322 Types aren't compatible with exact object types\n\t\t\tplugins: { tailwindcss },\n\t\t\trules: {\n\t\t\t\t\"tailwindcss/classnames-order\": \"off\", // Conflicts with prettier\n\t\t\t\t\"tailwindcss/no-custom-classname\": \"warn\",\n\t\t\t},\n\t\t\tsettings: {\n\t\t\t\ttailwindcss: {\n\t\t\t\t\tcssConfigPath: config,\n\t\t\t\t\tcssFiles: [\n\t\t\t\t\t\t\"**/*.css\",\n\t\t\t\t\t\t\"!**/node_modules\",\n\t\t\t\t\t\t\"!**/vendor\",\n\t\t\t\t\t\t\"!**/.*\",\n\t\t\t\t\t\t\"!**/dist\",\n\t\t\t\t\t\t\"!**/build\",\n\t\t\t\t\t],\n\t\t\t\t\tfunctions: [\"classnames\", \"clsx\", \"ctl\", \"twMerge\", ...callees],\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t]);\n};\n"]}
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@rootreeweb/linting",
3
- "version": "4.2.5",
3
+ "version": "4.2.7",
4
4
  "description": "Shared configurations for ESLint and Stylelint",
5
5
  "repository": {
6
6
  "type": "git",
7
- "url": "git+https://github.com/rootreeweb/linting.git"
7
+ "url": "git+https://github.com/rootreeweb/meta-tools.git"
8
8
  },
9
9
  "license": "",
10
10
  "author": {
@@ -40,14 +40,14 @@
40
40
  "dependencies": {
41
41
  "@eslint/js": "^10.0.1",
42
42
  "@ianvs/prettier-plugin-sort-imports": "^4.7.1",
43
- "@next/eslint-plugin-next": "^16.2.9",
43
+ "@next/eslint-plugin-next": "^16.2.10",
44
44
  "@rootreeweb/js-lib": "^4.0.18",
45
- "@tanstack/eslint-plugin-query": "^5.101.0",
45
+ "@tanstack/eslint-plugin-query": "^5.101.2",
46
46
  "@vitest/eslint-plugin": "^1.6.20",
47
47
  "eslint-import-resolver-typescript": "^4.4.5",
48
- "eslint-plugin-astro": "^1.7.0",
48
+ "eslint-plugin-astro": "^2.1.1",
49
49
  "eslint-plugin-import": "^2.32.0",
50
- "eslint-plugin-jsdoc": "^63.0.5",
50
+ "eslint-plugin-jsdoc": "^63.0.10",
51
51
  "eslint-plugin-jsx-a11y": "^6.10.2",
52
52
  "eslint-plugin-perfectionist": "^5.9.1",
53
53
  "eslint-plugin-promise": "^7.3.0",
@@ -56,12 +56,12 @@
56
56
  "eslint-plugin-react-hooks": "^7.1.1",
57
57
  "eslint-plugin-react-you-might-not-need-an-effect": "^1.0.1",
58
58
  "eslint-plugin-security": "^4.0.1",
59
- "eslint-plugin-sonarjs": "^4.0.3",
60
- "eslint-plugin-tailwindcss": "^4.0.0-beta.0",
59
+ "eslint-plugin-sonarjs": "^4.1.0",
60
+ "eslint-plugin-tailwindcss": "^4.0.6",
61
61
  "eslint-plugin-testing-library": "^7.16.2",
62
- "eslint-plugin-turbo": "^2.9.18",
63
- "globals": "^17.6.0",
64
- "postcss": "^8.5.15",
62
+ "eslint-plugin-turbo": "^2.10.2",
63
+ "globals": "^17.7.0",
64
+ "postcss": "^8.5.16",
65
65
  "prettier-plugin-astro": "^0.14.1",
66
66
  "prettier-plugin-jsdoc": "^1.8.1",
67
67
  "prettier-plugin-packagejson": "^3.0.2",
@@ -70,27 +70,26 @@
70
70
  "stylelint-config-standard-scss": "17.0.0",
71
71
  "stylelint-config-tailwindcss": "1.0.1",
72
72
  "stylelint-prettier": "5.0.3",
73
- "tailwindcss": "^4.3.1",
74
- "typescript-eslint": "^8.61.1"
73
+ "tailwindcss": "^4.3.2",
74
+ "typescript-eslint": "^8.62.1"
75
75
  },
76
76
  "devDependencies": {
77
- "@rootreeweb/tsconfigs": "3.3.12",
77
+ "@rootreeweb/tsconfigs": "3.3.14",
78
78
  "@types/eslint-plugin-jsx-a11y": "^6.10.1",
79
79
  "@types/eslint-plugin-security": "^3.0.1",
80
- "@types/eslint-plugin-tailwindcss": "^3.17.0",
81
- "@types/node": "^25.9.3",
80
+ "@types/node": "^26.1.0",
82
81
  "@types/react": "^19.2.17",
83
- "@typescript/native-preview": "^7.0.0-dev.20260617.2",
82
+ "@typescript/native-preview": "^7.0.0-dev.20260703.1",
84
83
  "@vitest/coverage-v8": "^4.1.9",
85
84
  "@vitest/ui": "4.1.9",
86
85
  "del-cli": "^7.0.0",
87
- "eslint": "^10.5.0",
86
+ "eslint": "^10.6.0",
88
87
  "husky": "^9.1.7",
89
- "knip": "^6.17.1",
90
- "prettier": "~3.8.4",
88
+ "knip": "^6.24.0",
89
+ "prettier": "~3.8.5",
91
90
  "react": "^19.2.7",
92
- "stylelint": "~17.13.0",
93
- "turbo": "~2.9.18",
91
+ "stylelint": "~17.14.0",
92
+ "turbo": "~2.10.2",
94
93
  "typescript": "^6.0.3",
95
94
  "vitest": "^4.1.9"
96
95
  },
@@ -101,7 +100,7 @@
101
100
  "prettier": "~3.8.0"
102
101
  },
103
102
  "optionalDependencies": {
104
- "stylelint": "~17.13.0",
105
- "turbo": "~2.9.18"
103
+ "stylelint": "~17.14.0",
104
+ "turbo": "~2.10.2"
106
105
  }
107
106
  }