@icebreakers/eslint-config 4.0.4 → 4.0.5
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/dist/index.cjs +27 -5
- package/dist/index.d.cts +5 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +23 -1
- package/index.d.ts +1 -0
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -31,13 +31,13 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
31
31
|
enumerable: true
|
|
32
32
|
}) : target, mod));
|
|
33
33
|
//#endregion
|
|
34
|
-
let node_fs = require("node:fs");
|
|
35
|
-
node_fs = __toESM(node_fs);
|
|
36
|
-
let node_module = require("node:module");
|
|
37
34
|
let node_path = require("node:path");
|
|
38
|
-
node_path = __toESM(node_path);
|
|
35
|
+
node_path = __toESM(node_path, 1);
|
|
39
36
|
let node_process = require("node:process");
|
|
40
|
-
node_process = __toESM(node_process);
|
|
37
|
+
node_process = __toESM(node_process, 1);
|
|
38
|
+
let node_fs = require("node:fs");
|
|
39
|
+
node_fs = __toESM(node_fs, 1);
|
|
40
|
+
let node_module = require("node:module");
|
|
41
41
|
let node_url = require("node:url");
|
|
42
42
|
//#region src/antfu.ts
|
|
43
43
|
var antfu_exports = /* @__PURE__ */ __exportAll({});
|
|
@@ -188,6 +188,24 @@ const MDX_PACKAGES = ["eslint-plugin-mdx"];
|
|
|
188
188
|
const VUE_A11Y_PACKAGES = ["eslint-plugin-vuejs-accessibility"];
|
|
189
189
|
const REACT_A11Y_PACKAGES = ["eslint-plugin-jsx-a11y"];
|
|
190
190
|
const QUERY_PACKAGES = ["@tanstack/eslint-plugin-query"];
|
|
191
|
+
const BETTER_TAILWIND_FILES = ["**/*.{js,mjs,cjs,ts,mts,cts,jsx,tsx,vue,html,md,mdx,astro,svelte}"];
|
|
192
|
+
const BETTER_TAILWIND_IGNORES = [
|
|
193
|
+
"**/*.json",
|
|
194
|
+
"**/*.json5",
|
|
195
|
+
"**/*.yaml",
|
|
196
|
+
"**/*.yml",
|
|
197
|
+
"**/*.{lock,lockb}",
|
|
198
|
+
"**/package.json",
|
|
199
|
+
"**/package-lock.json",
|
|
200
|
+
"**/pnpm-lock.yaml",
|
|
201
|
+
"**/yarn.lock",
|
|
202
|
+
"**/bun.lock",
|
|
203
|
+
"**/bun.lockb",
|
|
204
|
+
"**/composer.lock",
|
|
205
|
+
"**/Cargo.lock",
|
|
206
|
+
"**/Gemfile.lock",
|
|
207
|
+
"**/go.sum"
|
|
208
|
+
];
|
|
191
209
|
function resolveStylelintConfigLoader(moduleUrl = require("url").pathToFileURL(__filename).href) {
|
|
192
210
|
return moduleUrl.endsWith(".ts") ? new URL("./stylelint.ts", moduleUrl).href : new URL("./stylelint.js", moduleUrl).href;
|
|
193
211
|
}
|
|
@@ -196,15 +214,19 @@ function resolveTailwindPresets(option) {
|
|
|
196
214
|
if (typeof option === "object") {
|
|
197
215
|
if (!hasAllPackages(BETTER_TAILWIND_PACKAGES)) return [];
|
|
198
216
|
return [(0, antfu_exports.interopDefault)(import("eslint-plugin-better-tailwindcss")).then((eslintPluginBetterTailwindcss) => {
|
|
217
|
+
const cwd = option.cwd ?? (option.entryPoint ? node_path.default.dirname(option.entryPoint) : void 0) ?? node_process.default.cwd();
|
|
199
218
|
const betterTailwindcssRules = {
|
|
200
219
|
...eslintPluginBetterTailwindcss.configs["recommended-warn"].rules,
|
|
201
220
|
...eslintPluginBetterTailwindcss.configs["recommended-error"].rules
|
|
202
221
|
};
|
|
203
222
|
return {
|
|
204
223
|
name: "icebreaker/better-tailwindcss",
|
|
224
|
+
files: BETTER_TAILWIND_FILES,
|
|
225
|
+
ignores: BETTER_TAILWIND_IGNORES,
|
|
205
226
|
plugins: { "better-tailwindcss": eslintPluginBetterTailwindcss },
|
|
206
227
|
rules: betterTailwindcssRules,
|
|
207
228
|
settings: { "better-tailwindcss": {
|
|
229
|
+
cwd,
|
|
208
230
|
entryPoint: option.entryPoint,
|
|
209
231
|
tailwindConfig: option.tailwindConfig
|
|
210
232
|
} }
|
package/dist/index.d.cts
CHANGED
|
@@ -4112,6 +4112,11 @@ interface TailwindcssOption {
|
|
|
4112
4112
|
* Tailwind CSS v4 entry point, e.g. `src/global.css`.
|
|
4113
4113
|
*/
|
|
4114
4114
|
entryPoint?: string;
|
|
4115
|
+
/**
|
|
4116
|
+
* Working directory passed to eslint-plugin-better-tailwindcss.
|
|
4117
|
+
* Defaults to `dirname(entryPoint)` when present, otherwise `process.cwd()`.
|
|
4118
|
+
*/
|
|
4119
|
+
cwd?: string;
|
|
4115
4120
|
/**
|
|
4116
4121
|
* Tailwind CSS v3 config file path, e.g. `tailwind.config.js`.
|
|
4117
4122
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -4112,6 +4112,11 @@ interface TailwindcssOption {
|
|
|
4112
4112
|
* Tailwind CSS v4 entry point, e.g. `src/global.css`.
|
|
4113
4113
|
*/
|
|
4114
4114
|
entryPoint?: string;
|
|
4115
|
+
/**
|
|
4116
|
+
* Working directory passed to eslint-plugin-better-tailwindcss.
|
|
4117
|
+
* Defaults to `dirname(entryPoint)` when present, otherwise `process.cwd()`.
|
|
4118
|
+
*/
|
|
4119
|
+
cwd?: string;
|
|
4115
4120
|
/**
|
|
4116
4121
|
* Tailwind CSS v3 config file path, e.g. `tailwind.config.js`.
|
|
4117
4122
|
*/
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire } from "node:module";
|
|
2
|
-
import fs from "node:fs";
|
|
3
2
|
import path from "node:path";
|
|
4
3
|
import process from "node:process";
|
|
4
|
+
import fs from "node:fs";
|
|
5
5
|
import { fileURLToPath } from "node:url";
|
|
6
6
|
//#region \0rolldown/runtime.js
|
|
7
7
|
var __defProp = Object.defineProperty;
|
|
@@ -179,6 +179,24 @@ const MDX_PACKAGES = ["eslint-plugin-mdx"];
|
|
|
179
179
|
const VUE_A11Y_PACKAGES = ["eslint-plugin-vuejs-accessibility"];
|
|
180
180
|
const REACT_A11Y_PACKAGES = ["eslint-plugin-jsx-a11y"];
|
|
181
181
|
const QUERY_PACKAGES = ["@tanstack/eslint-plugin-query"];
|
|
182
|
+
const BETTER_TAILWIND_FILES = ["**/*.{js,mjs,cjs,ts,mts,cts,jsx,tsx,vue,html,md,mdx,astro,svelte}"];
|
|
183
|
+
const BETTER_TAILWIND_IGNORES = [
|
|
184
|
+
"**/*.json",
|
|
185
|
+
"**/*.json5",
|
|
186
|
+
"**/*.yaml",
|
|
187
|
+
"**/*.yml",
|
|
188
|
+
"**/*.{lock,lockb}",
|
|
189
|
+
"**/package.json",
|
|
190
|
+
"**/package-lock.json",
|
|
191
|
+
"**/pnpm-lock.yaml",
|
|
192
|
+
"**/yarn.lock",
|
|
193
|
+
"**/bun.lock",
|
|
194
|
+
"**/bun.lockb",
|
|
195
|
+
"**/composer.lock",
|
|
196
|
+
"**/Cargo.lock",
|
|
197
|
+
"**/Gemfile.lock",
|
|
198
|
+
"**/go.sum"
|
|
199
|
+
];
|
|
182
200
|
function resolveStylelintConfigLoader(moduleUrl = import.meta.url) {
|
|
183
201
|
return moduleUrl.endsWith(".ts") ? new URL("./stylelint.ts", moduleUrl).href : new URL("./stylelint.js", moduleUrl).href;
|
|
184
202
|
}
|
|
@@ -187,15 +205,19 @@ function resolveTailwindPresets(option) {
|
|
|
187
205
|
if (typeof option === "object") {
|
|
188
206
|
if (!hasAllPackages(BETTER_TAILWIND_PACKAGES)) return [];
|
|
189
207
|
return [(0, antfu_exports.interopDefault)(import("eslint-plugin-better-tailwindcss")).then((eslintPluginBetterTailwindcss) => {
|
|
208
|
+
const cwd = option.cwd ?? (option.entryPoint ? path.dirname(option.entryPoint) : void 0) ?? process.cwd();
|
|
190
209
|
const betterTailwindcssRules = {
|
|
191
210
|
...eslintPluginBetterTailwindcss.configs["recommended-warn"].rules,
|
|
192
211
|
...eslintPluginBetterTailwindcss.configs["recommended-error"].rules
|
|
193
212
|
};
|
|
194
213
|
return {
|
|
195
214
|
name: "icebreaker/better-tailwindcss",
|
|
215
|
+
files: BETTER_TAILWIND_FILES,
|
|
216
|
+
ignores: BETTER_TAILWIND_IGNORES,
|
|
196
217
|
plugins: { "better-tailwindcss": eslintPluginBetterTailwindcss },
|
|
197
218
|
rules: betterTailwindcssRules,
|
|
198
219
|
settings: { "better-tailwindcss": {
|
|
220
|
+
cwd,
|
|
199
221
|
entryPoint: option.entryPoint,
|
|
200
222
|
tailwindConfig: option.tailwindConfig
|
|
201
223
|
} }
|
package/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@icebreakers/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "4.0.
|
|
4
|
+
"version": "4.0.5",
|
|
5
5
|
"description": "ESLint preset from Icebreaker's dev-configs",
|
|
6
6
|
"author": "ice breaker <1324318532@qq.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
58
58
|
"eslint-plugin-react-hooks": "^7.0.1",
|
|
59
59
|
"eslint-plugin-react-refresh": "^0.5.2",
|
|
60
|
-
"eslint-plugin-tailwindcss": "3.18.
|
|
60
|
+
"eslint-plugin-tailwindcss": "3.18.3",
|
|
61
61
|
"eslint-plugin-vuejs-accessibility": "^2.5.0",
|
|
62
62
|
"@icebreakers/stylelint-config": "3.0.4",
|
|
63
63
|
"eslint-plugin-better-stylelint": "1.0.1"
|