@infernodesign/eslint-config 1.4.0 → 1.5.1
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/cli.js +2 -2
- package/dist/index.d.ts +14 -1
- package/dist/index.js +43 -2
- package/package.json +4 -3
package/dist/cli.js
CHANGED
|
@@ -9,7 +9,7 @@ import parse from "parse-gitignore";
|
|
|
9
9
|
import { execSync } from "node:child_process";
|
|
10
10
|
|
|
11
11
|
//#region package.json
|
|
12
|
-
var version = "1.
|
|
12
|
+
var version = "1.5.1";
|
|
13
13
|
|
|
14
14
|
//#endregion
|
|
15
15
|
//#region src/cli/constants.ts
|
|
@@ -172,7 +172,7 @@ async function updateEslintFiles(result) {
|
|
|
172
172
|
//#endregion
|
|
173
173
|
//#region src/cli/constants-generated.ts
|
|
174
174
|
const versionsMap = {
|
|
175
|
-
"@eslint-react/eslint-plugin": "^2.2.
|
|
175
|
+
"@eslint-react/eslint-plugin": "^2.2.3",
|
|
176
176
|
"@next/eslint-plugin-next": "^15.5.6",
|
|
177
177
|
"@unocss/eslint-plugin": "^66.5.4",
|
|
178
178
|
"astro-eslint-parser": "^1.2.2",
|
package/dist/index.d.ts
CHANGED
|
@@ -18055,6 +18055,7 @@ interface OptionsConfig extends OptionsComponentExts, OptionsProjectType {
|
|
|
18055
18055
|
storybook?: boolean | OptionsOverrides;
|
|
18056
18056
|
stylistic?: (OptionsOverrides & StylisticConfig) | boolean;
|
|
18057
18057
|
svelte?: boolean | OptionsOverrides;
|
|
18058
|
+
tailwindcss?: boolean | OptionsOverrides | OptionsTailwindcss;
|
|
18058
18059
|
test?: boolean | OptionsOverrides;
|
|
18059
18060
|
toml?: boolean | OptionsOverrides;
|
|
18060
18061
|
typescript?: boolean | OptionsTypescript;
|
|
@@ -18102,6 +18103,14 @@ interface OptionsRegExp {
|
|
|
18102
18103
|
interface OptionsStylistic {
|
|
18103
18104
|
stylistic?: boolean | StylisticConfig;
|
|
18104
18105
|
}
|
|
18106
|
+
interface OptionsTailwindcss {
|
|
18107
|
+
settings?: {
|
|
18108
|
+
tailwindcss?: {
|
|
18109
|
+
entryPoint?: string;
|
|
18110
|
+
tailwindConfig?: string;
|
|
18111
|
+
};
|
|
18112
|
+
};
|
|
18113
|
+
}
|
|
18105
18114
|
type OptionsTypescript = (OptionsOverrides & OptionsTypeScriptParserOptions) | (OptionsOverrides & OptionsTypeScriptWithTypes);
|
|
18106
18115
|
interface OptionsTypeScriptParserOptions {
|
|
18107
18116
|
filesTypeAware?: string[];
|
|
@@ -18141,6 +18150,7 @@ declare const defaultPluginRenaming: {
|
|
|
18141
18150
|
'@next/next': string;
|
|
18142
18151
|
'@stylistic': string;
|
|
18143
18152
|
'@typescript-eslint': string;
|
|
18153
|
+
'better-tailwindcss': string;
|
|
18144
18154
|
'import-lite': string;
|
|
18145
18155
|
n: string;
|
|
18146
18156
|
vitest: string;
|
|
@@ -18227,6 +18237,9 @@ declare function stylistic(options?: StylisticOptions): Promise<TypedFlatConfigI
|
|
|
18227
18237
|
//#region src/configs/svelte.d.ts
|
|
18228
18238
|
declare function svelte(options?: OptionsFiles & OptionsHasTypeScript & OptionsOverrides & OptionsStylistic): Promise<TypedFlatConfigItem[]>;
|
|
18229
18239
|
//#endregion
|
|
18240
|
+
//#region src/configs/tailwindcss.d.ts
|
|
18241
|
+
declare function tailwindcss(options?: OptionsFiles & OptionsOverrides & OptionsTailwindcss & OptionsTypeScriptWithTypes): Promise<TypedFlatConfigItem[]>;
|
|
18242
|
+
//#endregion
|
|
18230
18243
|
//#region src/configs/test.d.ts
|
|
18231
18244
|
declare function test(options?: OptionsFiles & OptionsIsInEditor & OptionsOverrides): Promise<TypedFlatConfigItem[]>;
|
|
18232
18245
|
//#endregion
|
|
@@ -18319,4 +18332,4 @@ declare function renamePluginInConfigs(configs: TypedFlatConfigItem[], map: Reco
|
|
|
18319
18332
|
declare function renameRules(rules: Record<string, any>, map: Record<string, string>): Record<string, any>;
|
|
18320
18333
|
declare function toArray<T>(value: T | T[]): T[];
|
|
18321
18334
|
//#endregion
|
|
18322
|
-
export { Awaitable, type ConfigNames, GLOB_ALL_SRC, GLOB_ASTRO, GLOB_ASTRO_TS, GLOB_CSS, GLOB_EXCLUDE, GLOB_GRAPHQL, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_IN_MARKDOWN, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STORYBOOK, GLOB_STYLE, GLOB_SVELTE, GLOB_SVG, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_XML, GLOB_YAML, OptionsComponentExts, OptionsConfig, OptionsFiles, OptionsFormatters, OptionsHasTypeScript, OptionsIsInEditor, OptionsJSX, OptionsJSXA11y, OptionsOverrides, OptionsProjectType, OptionsRegExp, OptionsStylistic, OptionsTypeScriptParserOptions, OptionsTypeScriptWithTypes, OptionsTypescript, OptionsUnicorn, OptionsUnoCSS, OptionsVue, ResolvedOptions, Rules, StylisticConfig, StylisticConfigDefaults, StylisticOptions, TypedFlatConfigItem, astro, combine, command, comments, inferno as default, inferno, defaultPluginRenaming, disables, ensurePackages, formatters, getOverrides, ignores, imports, interopDefault, isInEditorEnv, isInGitHooksOrLintStaged, isPackageInScope, javascript, jsdoc, jsonc, jsx, markdown, nextjs, node, packageExportsSortOrder, packageSortOrder, parserPlain, perfectionist, pnpm, react, regexp, renamePluginInConfigs, renameRules, resolveSubOptions, solid, sortPackageJson, sortTsconfig, storybook, stylistic, svelte, test, toArray, toml, typescript, unicorn, unocss, vue, yaml };
|
|
18335
|
+
export { Awaitable, type ConfigNames, GLOB_ALL_SRC, GLOB_ASTRO, GLOB_ASTRO_TS, GLOB_CSS, GLOB_EXCLUDE, GLOB_GRAPHQL, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_IN_MARKDOWN, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STORYBOOK, GLOB_STYLE, GLOB_SVELTE, GLOB_SVG, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_XML, GLOB_YAML, OptionsComponentExts, OptionsConfig, OptionsFiles, OptionsFormatters, OptionsHasTypeScript, OptionsIsInEditor, OptionsJSX, OptionsJSXA11y, OptionsOverrides, OptionsProjectType, OptionsRegExp, OptionsStylistic, OptionsTailwindcss, OptionsTypeScriptParserOptions, OptionsTypeScriptWithTypes, OptionsTypescript, OptionsUnicorn, OptionsUnoCSS, OptionsVue, ResolvedOptions, Rules, StylisticConfig, StylisticConfigDefaults, StylisticOptions, TypedFlatConfigItem, astro, combine, command, comments, inferno as default, inferno, defaultPluginRenaming, disables, ensurePackages, formatters, getOverrides, ignores, imports, interopDefault, isInEditorEnv, isInGitHooksOrLintStaged, isPackageInScope, javascript, jsdoc, jsonc, jsx, markdown, nextjs, node, packageExportsSortOrder, packageSortOrder, parserPlain, perfectionist, pnpm, react, regexp, renamePluginInConfigs, renameRules, resolveSubOptions, solid, sortPackageJson, sortTsconfig, storybook, stylistic, svelte, tailwindcss, test, toArray, toml, typescript, unicorn, unocss, vue, yaml };
|
package/dist/index.js
CHANGED
|
@@ -1838,6 +1838,45 @@ async function svelte(options = {}) {
|
|
|
1838
1838
|
}];
|
|
1839
1839
|
}
|
|
1840
1840
|
|
|
1841
|
+
//#endregion
|
|
1842
|
+
//#region src/configs/tailwindcss.ts
|
|
1843
|
+
async function tailwindcss(options = {}) {
|
|
1844
|
+
const { files = [GLOB_SRC], overrides = {} } = options;
|
|
1845
|
+
await ensurePackages(["eslint-plugin-better-tailwindcss"]);
|
|
1846
|
+
if (!isPackageExists("tailwindcss")) return [];
|
|
1847
|
+
const tsconfigPath = options?.tsconfigPath !== void 0 ? toArray(options.tsconfigPath) : void 0;
|
|
1848
|
+
const isTypeAware = !!tsconfigPath;
|
|
1849
|
+
const [pluginTailwindCSS, parserTs] = await Promise.all([await interopDefault(import("eslint-plugin-better-tailwindcss")), await interopDefault(import("@typescript-eslint/parser"))]);
|
|
1850
|
+
return [{
|
|
1851
|
+
languageOptions: {
|
|
1852
|
+
parser: parserTs,
|
|
1853
|
+
parserOptions: {
|
|
1854
|
+
ecmaFeatures: { jsx: true },
|
|
1855
|
+
...isTypeAware ? {
|
|
1856
|
+
jsxPragma: null,
|
|
1857
|
+
project: tsconfigPath,
|
|
1858
|
+
tsconfigRootDir: process.cwd()
|
|
1859
|
+
} : {}
|
|
1860
|
+
}
|
|
1861
|
+
},
|
|
1862
|
+
name: "inferno/tailwindcss/setup",
|
|
1863
|
+
plugins: { "tailwindcss": pluginTailwindCSS },
|
|
1864
|
+
settings: { tailwindcss: {
|
|
1865
|
+
entryPoint: options.settings?.tailwindcss?.entryPoint || "src/styles/globals.css",
|
|
1866
|
+
tailwindConfig: options.settings?.tailwindcss?.tailwindConfig || "tailwind.config.js"
|
|
1867
|
+
} }
|
|
1868
|
+
}, {
|
|
1869
|
+
files,
|
|
1870
|
+
name: "inferno/tailwindcss/rules",
|
|
1871
|
+
rules: {
|
|
1872
|
+
...pluginTailwindCSS.configs["recommended-error"]?.rules,
|
|
1873
|
+
"tailwindcss/enforce-consistent-line-wrapping": "off",
|
|
1874
|
+
"tailwindcss/no-unregistered-classes": "off",
|
|
1875
|
+
...overrides
|
|
1876
|
+
}
|
|
1877
|
+
}];
|
|
1878
|
+
}
|
|
1879
|
+
|
|
1841
1880
|
//#endregion
|
|
1842
1881
|
//#region src/configs/test.ts
|
|
1843
1882
|
let _pluginTest;
|
|
@@ -2411,6 +2450,7 @@ const defaultPluginRenaming = {
|
|
|
2411
2450
|
"@next/next": "next",
|
|
2412
2451
|
"@stylistic": "style",
|
|
2413
2452
|
"@typescript-eslint": "ts",
|
|
2453
|
+
"better-tailwindcss": "tailwindcss",
|
|
2414
2454
|
"import-lite": "import",
|
|
2415
2455
|
"n": "node",
|
|
2416
2456
|
"vitest": "test",
|
|
@@ -2434,7 +2474,7 @@ function getOverrides(options, key) {
|
|
|
2434
2474
|
* The merged ESLint configurations.
|
|
2435
2475
|
*/
|
|
2436
2476
|
function inferno(options = {}, ...userConfigs) {
|
|
2437
|
-
const { astro: enableAstro = false, autoRenamePlugins = true, componentExts = [], gitignore: enableGitignore = true, imports: enableImports = true, jsx: enableJsx = true, nextjs: enableNextjs = false, pnpm: enableCatalogs = false, react: enableReact = false, regexp: enableRegexp = true, solid: enableSolid = false, storybook: enableStorybook = false, svelte: enableSvelte = false, typescript: enableTypeScript = isPackageExists("typescript"), unicorn: enableUnicorn = true, unocss: enableUnoCSS = false, vue: enableVue = VuePackages.some((i) => isPackageExists(i)) } = options;
|
|
2477
|
+
const { astro: enableAstro = false, autoRenamePlugins = true, componentExts = [], gitignore: enableGitignore = true, imports: enableImports = true, jsx: enableJsx = true, nextjs: enableNextjs = false, pnpm: enableCatalogs = false, react: enableReact = false, regexp: enableRegexp = true, solid: enableSolid = false, storybook: enableStorybook = false, svelte: enableSvelte = false, tailwindcss: enableTailwindcss = false, typescript: enableTypeScript = isPackageExists("typescript"), unicorn: enableUnicorn = true, unocss: enableUnoCSS = false, vue: enableVue = VuePackages.some((i) => isPackageExists(i)) } = options;
|
|
2438
2478
|
let isInEditor = options.isInEditor;
|
|
2439
2479
|
if (isInEditor == null) {
|
|
2440
2480
|
isInEditor = isInEditorEnv();
|
|
@@ -2476,6 +2516,7 @@ function inferno(options = {}, ...userConfigs) {
|
|
|
2476
2516
|
overrides: getOverrides(options, "stylistic")
|
|
2477
2517
|
}));
|
|
2478
2518
|
if (enableRegexp) configs$1.push(regexp(typeof enableRegexp === "boolean" ? {} : enableRegexp));
|
|
2519
|
+
if (enableTailwindcss) configs$1.push(tailwindcss({ overrides: getOverrides(options, "tailwindcss") }));
|
|
2479
2520
|
if (options.test ?? true) configs$1.push(test({
|
|
2480
2521
|
isInEditor,
|
|
2481
2522
|
overrides: getOverrides(options, "test")
|
|
@@ -2555,4 +2596,4 @@ function resolveSubOptions(options, key) {
|
|
|
2555
2596
|
var src_default = inferno;
|
|
2556
2597
|
|
|
2557
2598
|
//#endregion
|
|
2558
|
-
export { GLOB_ALL_SRC, GLOB_ASTRO, GLOB_ASTRO_TS, GLOB_CSS, GLOB_EXCLUDE, GLOB_GRAPHQL, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_IN_MARKDOWN, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STORYBOOK, GLOB_STYLE, GLOB_SVELTE, GLOB_SVG, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_XML, GLOB_YAML, StylisticConfigDefaults, astro, combine, command, comments, src_default as default, defaultPluginRenaming, disables, ensurePackages, formatters, getOverrides, ignores, imports, inferno, interopDefault, isInEditorEnv, isInGitHooksOrLintStaged, isPackageInScope, javascript, jsdoc, jsonc, jsx, markdown, nextjs, node, packageExportsSortOrder, packageSortOrder, parserPlain, perfectionist, pnpm, react, regexp, renamePluginInConfigs, renameRules, resolveSubOptions, solid, sortPackageJson, sortTsconfig, storybook, stylistic, svelte, test, toArray, toml, typescript, unicorn, unocss, vue, yaml };
|
|
2599
|
+
export { GLOB_ALL_SRC, GLOB_ASTRO, GLOB_ASTRO_TS, GLOB_CSS, GLOB_EXCLUDE, GLOB_GRAPHQL, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_IN_MARKDOWN, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STORYBOOK, GLOB_STYLE, GLOB_SVELTE, GLOB_SVG, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_XML, GLOB_YAML, StylisticConfigDefaults, astro, combine, command, comments, src_default as default, defaultPluginRenaming, disables, ensurePackages, formatters, getOverrides, ignores, imports, inferno, interopDefault, isInEditorEnv, isInGitHooksOrLintStaged, isPackageInScope, javascript, jsdoc, jsonc, jsx, markdown, nextjs, node, packageExportsSortOrder, packageSortOrder, parserPlain, perfectionist, pnpm, react, regexp, renamePluginInConfigs, renameRules, resolveSubOptions, solid, sortPackageJson, sortTsconfig, storybook, stylistic, svelte, tailwindcss, test, toArray, toml, typescript, unicorn, unocss, vue, yaml };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@infernodesign/eslint-config",
|
|
3
3
|
"description": "ESLint config for Inferno Design.",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.5.1",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "Inferno Design <support@infernodesign.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -49,6 +49,7 @@
|
|
|
49
49
|
"eslint-flat-config-utils": "^2.1.4",
|
|
50
50
|
"eslint-merge-processors": "^2.0.0",
|
|
51
51
|
"eslint-plugin-antfu": "^3.1.1",
|
|
52
|
+
"eslint-plugin-better-tailwindcss": "^3.7.10",
|
|
52
53
|
"eslint-plugin-command": "^3.3.1",
|
|
53
54
|
"eslint-plugin-import-lite": "^0.3.0",
|
|
54
55
|
"eslint-plugin-jsdoc": "^61.1.5",
|
|
@@ -73,7 +74,7 @@
|
|
|
73
74
|
"yaml-eslint-parser": "^1.3.0"
|
|
74
75
|
},
|
|
75
76
|
"devDependencies": {
|
|
76
|
-
"@eslint-react/eslint-plugin": "^2.2.
|
|
77
|
+
"@eslint-react/eslint-plugin": "^2.2.3",
|
|
77
78
|
"@eslint/config-inspector": "^1.3.0",
|
|
78
79
|
"@next/eslint-plugin-next": "^15.5.6",
|
|
79
80
|
"@prettier/plugin-xml": "^3.4.2",
|
|
@@ -110,7 +111,7 @@
|
|
|
110
111
|
"@infernodesign/typescript-config": "1.2.0"
|
|
111
112
|
},
|
|
112
113
|
"peerDependencies": {
|
|
113
|
-
"@eslint-react/eslint-plugin": "^2.2.
|
|
114
|
+
"@eslint-react/eslint-plugin": "^2.2.3",
|
|
114
115
|
"@next/eslint-plugin-next": "^15.5.6",
|
|
115
116
|
"@prettier/plugin-xml": "^3.4.2",
|
|
116
117
|
"@unocss/eslint-plugin": "^66.5.4",
|