@infernodesign/eslint-config 1.4.0 → 1.5.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/dist/cli.js +1 -1
- package/dist/index.d.ts +13 -1
- package/dist/index.js +42 -2
- package/package.json +2 -1
package/dist/cli.js
CHANGED
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[];
|
|
@@ -18227,6 +18236,9 @@ declare function stylistic(options?: StylisticOptions): Promise<TypedFlatConfigI
|
|
|
18227
18236
|
//#region src/configs/svelte.d.ts
|
|
18228
18237
|
declare function svelte(options?: OptionsFiles & OptionsHasTypeScript & OptionsOverrides & OptionsStylistic): Promise<TypedFlatConfigItem[]>;
|
|
18229
18238
|
//#endregion
|
|
18239
|
+
//#region src/configs/tailwindcss.d.ts
|
|
18240
|
+
declare function tailwindcss(options?: OptionsFiles & OptionsOverrides & OptionsTailwindcss & OptionsTypeScriptWithTypes): Promise<TypedFlatConfigItem[]>;
|
|
18241
|
+
//#endregion
|
|
18230
18242
|
//#region src/configs/test.d.ts
|
|
18231
18243
|
declare function test(options?: OptionsFiles & OptionsIsInEditor & OptionsOverrides): Promise<TypedFlatConfigItem[]>;
|
|
18232
18244
|
//#endregion
|
|
@@ -18319,4 +18331,4 @@ declare function renamePluginInConfigs(configs: TypedFlatConfigItem[], map: Reco
|
|
|
18319
18331
|
declare function renameRules(rules: Record<string, any>, map: Record<string, string>): Record<string, any>;
|
|
18320
18332
|
declare function toArray<T>(value: T | T[]): T[];
|
|
18321
18333
|
//#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 };
|
|
18334
|
+
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: "config/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: "config/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;
|
|
@@ -2434,7 +2473,7 @@ function getOverrides(options, key) {
|
|
|
2434
2473
|
* The merged ESLint configurations.
|
|
2435
2474
|
*/
|
|
2436
2475
|
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;
|
|
2476
|
+
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
2477
|
let isInEditor = options.isInEditor;
|
|
2439
2478
|
if (isInEditor == null) {
|
|
2440
2479
|
isInEditor = isInEditorEnv();
|
|
@@ -2476,6 +2515,7 @@ function inferno(options = {}, ...userConfigs) {
|
|
|
2476
2515
|
overrides: getOverrides(options, "stylistic")
|
|
2477
2516
|
}));
|
|
2478
2517
|
if (enableRegexp) configs$1.push(regexp(typeof enableRegexp === "boolean" ? {} : enableRegexp));
|
|
2518
|
+
if (enableTailwindcss) configs$1.push(tailwindcss({ overrides: getOverrides(options, "tailwindcss") }));
|
|
2479
2519
|
if (options.test ?? true) configs$1.push(test({
|
|
2480
2520
|
isInEditor,
|
|
2481
2521
|
overrides: getOverrides(options, "test")
|
|
@@ -2555,4 +2595,4 @@ function resolveSubOptions(options, key) {
|
|
|
2555
2595
|
var src_default = inferno;
|
|
2556
2596
|
|
|
2557
2597
|
//#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 };
|
|
2598
|
+
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.0",
|
|
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",
|