@shayanthenerd/eslint-config 0.35.0 → 0.37.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 +1 -2
- package/dist/configs/astro.mjs +2 -3
- package/dist/configs/baseline.mjs +2 -3
- package/dist/configs/css.mjs +2 -3
- package/dist/configs/cypress.mjs +2 -3
- package/dist/configs/html.mjs +2 -3
- package/dist/configs/importX.mjs +2 -3
- package/dist/configs/javascript.mjs +2 -3
- package/dist/configs/markdown.mjs +2 -3
- package/dist/configs/next.mjs +2 -3
- package/dist/configs/node.mjs +2 -3
- package/dist/configs/nuxt.mjs +2 -3
- package/dist/configs/packageJson.mjs +2 -3
- package/dist/configs/perfectionist.mjs +2 -3
- package/dist/configs/playwright.mjs +2 -3
- package/dist/configs/promise.mjs +2 -3
- package/dist/configs/react.mjs +2 -3
- package/dist/configs/storybook.mjs +2 -3
- package/dist/configs/stylistic.mjs +2 -3
- package/dist/configs/tailwind.mjs +2 -3
- package/dist/configs/tanstack.mjs +2 -3
- package/dist/configs/typescript.mjs +2 -3
- package/dist/configs/unicorn.mjs +2 -3
- package/dist/configs/vitest.mjs +2 -3
- package/dist/configs/vue.mjs +2 -3
- package/dist/configs/zod.mjs +2 -3
- package/dist/helpers/globs.mjs +1 -2
- package/dist/helpers/ignores/defaultIgnorePatterns.mjs +1 -2
- package/dist/helpers/ignores/getIgnorePatterns.mjs +1 -2
- package/dist/helpers/ignores/resolveGitignorePatterns.mjs +1 -2
- package/dist/helpers/isPackageDetected.mjs +1 -2
- package/dist/helpers/options/defaultOptions.mjs +1 -2
- package/dist/helpers/options/enableDetectedConfigs.mjs +2 -3
- package/dist/helpers/options/mergeWithDefaults.mjs +1 -2
- package/dist/helpers/vue/getRestrictedVueElements.mjs +1 -2
- package/dist/helpers/vue/getRestrictedVueInputs.mjs +1 -2
- package/dist/index.d.mts +0 -2
- package/dist/index.mjs +3 -4
- package/dist/prettier.config.d.mts +0 -2
- package/dist/prettier.config.mjs +1 -2
- package/dist/rules/astro.mjs +1 -2
- package/dist/rules/baseline.mjs +1 -2
- package/dist/rules/css.mjs +5 -2
- package/dist/rules/cypress.mjs +1 -2
- package/dist/rules/html.mjs +1 -2
- package/dist/rules/importX.mjs +1 -2
- package/dist/rules/javascript.mjs +1 -2
- package/dist/rules/markdown.mjs +1 -2
- package/dist/rules/next.mjs +1 -2
- package/dist/rules/node.mjs +1 -2
- package/dist/rules/nuxt.mjs +1 -2
- package/dist/rules/packageJson.mjs +44 -7
- package/dist/rules/perfectionist.mjs +1 -2
- package/dist/rules/playwright.mjs +1 -2
- package/dist/rules/promise.mjs +1 -2
- package/dist/rules/react.mjs +1 -2
- package/dist/rules/storybook.mjs +1 -2
- package/dist/rules/stylistic.mjs +1 -2
- package/dist/rules/tailwind.mjs +1 -2
- package/dist/rules/tanstack.mjs +1 -2
- package/dist/rules/typescript.mjs +2 -3
- package/dist/rules/unicorn.mjs +1 -2
- package/dist/rules/vitest.mjs +1 -2
- package/dist/rules/vue.mjs +6 -4
- package/dist/rules/zod.mjs +1 -2
- package/dist/types/eslint-schema.d.mts +878 -495
- package/dist/types/eslintRules.d.mts +0 -2
- package/dist/types/helpers.d.mts +0 -2
- package/dist/types/index.d.mts +0 -2
- package/dist/types/options/baseline.d.mts +0 -2
- package/dist/types/options/markdown.d.mts +0 -2
- package/dist/types/options/nuxt.d.mts +0 -2
- package/dist/types/options/react.d.mts +0 -2
- package/dist/types/options/stylistic.d.mts +0 -2
- package/dist/types/options/tailwind.d.mts +0 -2
- package/dist/types/options/tanstack.d.mts +0 -2
- package/dist/types/options/test.d.mts +0 -2
- package/dist/types/options/typescript.d.mts +0 -2
- package/dist/types/options/vue.d.mts +0 -2
- package/dist/types/options/zod.d.mts +0 -2
- package/dist/utils/isEmptyString.mjs +1 -2
- package/dist/utils/isEnabled.mjs +1 -2
- package/dist/utils/isTruthy.mjs +1 -2
- package/package.json +31 -31
package/README.md
CHANGED
|
@@ -302,10 +302,9 @@ You can also add the following to your _.vscode/settings.json_:
|
|
|
302
302
|
{ "rule": "*quotes", "severity": "off", "fixable": true },
|
|
303
303
|
{ "rule": "import*", "severity": "off", "fixable": true },
|
|
304
304
|
{ "rule": "*-spac*", "severity": "off", "fixable": true },
|
|
305
|
-
{ "rule": "*order
|
|
305
|
+
{ "rule": "*order*", "severity": "off", "fixable": true },
|
|
306
306
|
{ "rule": "*newline*", "severity": "off", "fixable": true },
|
|
307
307
|
{ "rule": "*attribute*", "severity": "off", "fixable": true },
|
|
308
|
-
{ "rule": "package-json/order-properties", "severity": "off", "fixable": true },
|
|
309
308
|
{ "rule": "vue/max-len", "severity": "off", "fixable": true },
|
|
310
309
|
{ "rule": "vue/comma-dangle", "severity": "off", "fixable": true },
|
|
311
310
|
{ "rule": "vue/space-in-parens", "severity": "off", "fixable": true }
|
package/dist/configs/astro.mjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { globs } from "../helpers/globs.mjs";
|
|
2
2
|
import { defaultOptions } from "../helpers/options/defaultOptions.mjs";
|
|
3
|
-
import { isEnabled } from "../utils/isEnabled.mjs";
|
|
4
3
|
import { getAstroRules } from "../rules/astro.mjs";
|
|
4
|
+
import { isEnabled } from "../utils/isEnabled.mjs";
|
|
5
5
|
import * as eslintParserAstro from "astro-eslint-parser";
|
|
6
6
|
import { mergeConfigs } from "eslint-flat-config-utils";
|
|
7
7
|
import eslintPluginAstro from "eslint-plugin-astro";
|
|
8
8
|
import { parser } from "typescript-eslint";
|
|
9
9
|
import path from "node:path";
|
|
10
|
-
|
|
10
|
+
// src/configs/astro.ts
|
|
11
11
|
function getAstroConfig(options) {
|
|
12
12
|
const { tsConfig, configs: { astro } } = options;
|
|
13
13
|
const { overrides } = isEnabled(astro) ? astro : defaultOptions.configs.astro;
|
|
@@ -33,5 +33,4 @@ function getAstroConfig(options) {
|
|
|
33
33
|
};
|
|
34
34
|
return mergeConfigs(astroConfig, overrides);
|
|
35
35
|
}
|
|
36
|
-
//#endregion
|
|
37
36
|
export { getAstroConfig };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { globs } from "../helpers/globs.mjs";
|
|
2
|
-
import { isEnabled } from "../utils/isEnabled.mjs";
|
|
3
2
|
import { getBaselineRules } from "../rules/baseline.mjs";
|
|
3
|
+
import { isEnabled } from "../utils/isEnabled.mjs";
|
|
4
4
|
import { isTruthy } from "../utils/isTruthy.mjs";
|
|
5
5
|
import eslintPluginBaselineJs from "eslint-plugin-baseline-js";
|
|
6
|
-
|
|
6
|
+
// src/configs/baseline.ts
|
|
7
7
|
function getBaselineConfig(options) {
|
|
8
8
|
const { vue, astro } = options.configs;
|
|
9
9
|
return {
|
|
@@ -19,5 +19,4 @@ function getBaselineConfig(options) {
|
|
|
19
19
|
rules: getBaselineRules(options)
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
|
-
//#endregion
|
|
23
22
|
export { getBaselineConfig };
|
package/dist/configs/css.mjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { globs } from "../helpers/globs.mjs";
|
|
2
2
|
import { defaultOptions } from "../helpers/options/defaultOptions.mjs";
|
|
3
|
-
import { isEnabled } from "../utils/isEnabled.mjs";
|
|
4
3
|
import { getCssRules } from "../rules/css.mjs";
|
|
4
|
+
import { isEnabled } from "../utils/isEnabled.mjs";
|
|
5
5
|
import { mergeConfigs } from "eslint-flat-config-utils";
|
|
6
6
|
import eslintPluginCssicorn from "eslint-cssicorn";
|
|
7
7
|
import eslintPluginCss from "@eslint/css";
|
|
8
8
|
import { tailwind3, tailwind4 } from "tailwind-csstree";
|
|
9
|
-
|
|
9
|
+
// src/configs/css.ts
|
|
10
10
|
function getCssConfig(options) {
|
|
11
11
|
const { css, tailwind } = options.configs;
|
|
12
12
|
const { overrides } = isEnabled(css) ? css : defaultOptions.configs.css;
|
|
@@ -27,5 +27,4 @@ function getCssConfig(options) {
|
|
|
27
27
|
};
|
|
28
28
|
return mergeConfigs(cssConfig, overrides);
|
|
29
29
|
}
|
|
30
|
-
//#endregion
|
|
31
30
|
export { getCssConfig };
|
package/dist/configs/cypress.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { globs } from "../helpers/globs.mjs";
|
|
2
2
|
import { defaultOptions } from "../helpers/options/defaultOptions.mjs";
|
|
3
|
-
import { isEnabled } from "../utils/isEnabled.mjs";
|
|
4
3
|
import { getCypressRules } from "../rules/cypress.mjs";
|
|
4
|
+
import { isEnabled } from "../utils/isEnabled.mjs";
|
|
5
5
|
import { mergeConfigs } from "eslint-flat-config-utils";
|
|
6
6
|
import eslintPluginCypress from "eslint-plugin-cypress";
|
|
7
|
-
|
|
7
|
+
// src/configs/cypress.ts
|
|
8
8
|
function getCypressConfig(options) {
|
|
9
9
|
const { cypress } = options.configs.test;
|
|
10
10
|
const { overrides } = isEnabled(cypress) ? cypress : defaultOptions.configs.test.cypress;
|
|
@@ -17,5 +17,4 @@ function getCypressConfig(options) {
|
|
|
17
17
|
};
|
|
18
18
|
return mergeConfigs(cypressConfig, overrides);
|
|
19
19
|
}
|
|
20
|
-
//#endregion
|
|
21
20
|
export { getCypressConfig };
|
package/dist/configs/html.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { globs } from "../helpers/globs.mjs";
|
|
2
2
|
import { defaultOptions } from "../helpers/options/defaultOptions.mjs";
|
|
3
|
-
import { isEnabled } from "../utils/isEnabled.mjs";
|
|
4
3
|
import { getHtmlRules } from "../rules/html.mjs";
|
|
4
|
+
import { isEnabled } from "../utils/isEnabled.mjs";
|
|
5
5
|
import { mergeConfigs } from "eslint-flat-config-utils";
|
|
6
6
|
import eslintPluginUnicorn from "eslint-plugin-unicorn";
|
|
7
7
|
import eslintPluginHtml from "@html-eslint/eslint-plugin";
|
|
8
|
-
|
|
8
|
+
// src/configs/html.ts
|
|
9
9
|
function getHtmlConfig(options) {
|
|
10
10
|
const { html, unicorn } = options.configs;
|
|
11
11
|
const { overrides } = isEnabled(html) ? html : defaultOptions.configs.html;
|
|
@@ -21,5 +21,4 @@ function getHtmlConfig(options) {
|
|
|
21
21
|
};
|
|
22
22
|
return mergeConfigs(htmlConfig, overrides);
|
|
23
23
|
}
|
|
24
|
-
//#endregion
|
|
25
24
|
export { getHtmlConfig };
|
package/dist/configs/importX.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { globs } from "../helpers/globs.mjs";
|
|
2
2
|
import { defaultOptions } from "../helpers/options/defaultOptions.mjs";
|
|
3
|
+
import { getImportXRules } from "../rules/importX.mjs";
|
|
3
4
|
import { isEnabled } from "../utils/isEnabled.mjs";
|
|
4
5
|
import { isTruthy } from "../utils/isTruthy.mjs";
|
|
5
|
-
import { getImportXRules } from "../rules/importX.mjs";
|
|
6
6
|
import { mergeConfigs } from "eslint-flat-config-utils";
|
|
7
7
|
import eslintPluginImportX from "eslint-plugin-import-x";
|
|
8
|
-
|
|
8
|
+
// src/configs/importX.ts
|
|
9
9
|
function getImportXConfig(options) {
|
|
10
10
|
const { vue, astro, importX, typescript } = options.configs;
|
|
11
11
|
const { overrides } = isEnabled(importX) ? importX : defaultOptions.configs.importX;
|
|
@@ -23,5 +23,4 @@ function getImportXConfig(options) {
|
|
|
23
23
|
};
|
|
24
24
|
return mergeConfigs(importXConfig, overrides);
|
|
25
25
|
}
|
|
26
|
-
//#endregion
|
|
27
26
|
export { getImportXConfig };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { globs } from "../helpers/globs.mjs";
|
|
2
|
+
import { getJavaScriptRules } from "../rules/javascript.mjs";
|
|
2
3
|
import { isEnabled } from "../utils/isEnabled.mjs";
|
|
3
4
|
import { isTruthy } from "../utils/isTruthy.mjs";
|
|
4
|
-
import { getJavaScriptRules } from "../rules/javascript.mjs";
|
|
5
5
|
import { mergeConfigs } from "eslint-flat-config-utils";
|
|
6
6
|
import { parser } from "typescript-eslint";
|
|
7
7
|
import globals from "globals";
|
|
8
|
-
|
|
8
|
+
// src/configs/javascript.ts
|
|
9
9
|
function getJavascriptConfig(options) {
|
|
10
10
|
const { env, configs: { vue, astro, javascript: { overrides } }, project: { globals: { bun, node, deno, vitest, worker, browser, commonjs, nodeBuiltin, audioWorklet, webextension, sharedWorker, serviceworker, vue: vueGlobals, astro: astroGlobals, custom: userGlobals } } } = options;
|
|
11
11
|
const baseConfig = {
|
|
@@ -49,5 +49,4 @@ function getJavascriptConfig(options) {
|
|
|
49
49
|
};
|
|
50
50
|
return mergeConfigs(baseConfig, overrides);
|
|
51
51
|
}
|
|
52
|
-
//#endregion
|
|
53
52
|
export { getJavascriptConfig };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { globs } from "../helpers/globs.mjs";
|
|
2
2
|
import { defaultOptions } from "../helpers/options/defaultOptions.mjs";
|
|
3
|
-
import { isEnabled } from "../utils/isEnabled.mjs";
|
|
4
3
|
import { getMarkdownRules } from "../rules/markdown.mjs";
|
|
4
|
+
import { isEnabled } from "../utils/isEnabled.mjs";
|
|
5
5
|
import { mergeConfigs } from "eslint-flat-config-utils";
|
|
6
6
|
import eslintPluginUnicorn from "eslint-plugin-unicorn";
|
|
7
7
|
import eslintPluginMarkdown from "@eslint/markdown";
|
|
8
|
-
|
|
8
|
+
// src/configs/markdown.ts
|
|
9
9
|
function getMarkdownConfig(options) {
|
|
10
10
|
const { unicorn, markdown } = options.configs;
|
|
11
11
|
const { language, frontmatter, overrides } = isEnabled(markdown) ? markdown : defaultOptions.configs.markdown;
|
|
@@ -25,5 +25,4 @@ function getMarkdownConfig(options) {
|
|
|
25
25
|
};
|
|
26
26
|
return mergeConfigs(markdownConfig, overrides);
|
|
27
27
|
}
|
|
28
|
-
//#endregion
|
|
29
28
|
export { getMarkdownConfig };
|
package/dist/configs/next.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { globs } from "../helpers/globs.mjs";
|
|
2
2
|
import { defaultOptions } from "../helpers/options/defaultOptions.mjs";
|
|
3
|
-
import { isEnabled } from "../utils/isEnabled.mjs";
|
|
4
3
|
import { getNextRules } from "../rules/next.mjs";
|
|
4
|
+
import { isEnabled } from "../utils/isEnabled.mjs";
|
|
5
5
|
import { mergeConfigs } from "eslint-flat-config-utils";
|
|
6
6
|
import eslintPluginNext from "@next/eslint-plugin-next";
|
|
7
|
-
|
|
7
|
+
// src/configs/next.ts
|
|
8
8
|
function getNextConfig(options) {
|
|
9
9
|
const { packageDir, configs: { next } } = options;
|
|
10
10
|
const { overrides } = isEnabled(next) ? next : defaultOptions.configs.next;
|
|
@@ -17,5 +17,4 @@ function getNextConfig(options) {
|
|
|
17
17
|
};
|
|
18
18
|
return mergeConfigs(nextConfig, overrides);
|
|
19
19
|
}
|
|
20
|
-
//#endregion
|
|
21
20
|
export { getNextConfig };
|
package/dist/configs/node.mjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { globs } from "../helpers/globs.mjs";
|
|
2
2
|
import { defaultOptions } from "../helpers/options/defaultOptions.mjs";
|
|
3
|
+
import { getNodeRules } from "../rules/node.mjs";
|
|
3
4
|
import { isEnabled } from "../utils/isEnabled.mjs";
|
|
4
5
|
import { isTruthy } from "../utils/isTruthy.mjs";
|
|
5
|
-
import { getNodeRules } from "../rules/node.mjs";
|
|
6
6
|
import { mergeConfigs } from "eslint-flat-config-utils";
|
|
7
7
|
import path from "node:path";
|
|
8
8
|
import eslintPluginNode from "eslint-plugin-n";
|
|
9
|
-
|
|
9
|
+
// src/configs/node.ts
|
|
10
10
|
function getNodeConfig(options) {
|
|
11
11
|
const { tsConfig, configs: { vue, node, astro } } = options;
|
|
12
12
|
const { overrides } = isEnabled(node) ? node : defaultOptions.configs.node;
|
|
@@ -25,5 +25,4 @@ function getNodeConfig(options) {
|
|
|
25
25
|
};
|
|
26
26
|
return mergeConfigs(nodeConfig, overrides);
|
|
27
27
|
}
|
|
28
|
-
//#endregion
|
|
29
28
|
export { getNodeConfig };
|
package/dist/configs/nuxt.mjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { globs } from "../helpers/globs.mjs";
|
|
2
2
|
import { defaultOptions } from "../helpers/options/defaultOptions.mjs";
|
|
3
|
-
import { isEnabled } from "../utils/isEnabled.mjs";
|
|
4
3
|
import { getNuxtRules } from "../rules/nuxt.mjs";
|
|
4
|
+
import { isEnabled } from "../utils/isEnabled.mjs";
|
|
5
5
|
import { mergeConfigs } from "eslint-flat-config-utils";
|
|
6
6
|
import { parser } from "typescript-eslint";
|
|
7
7
|
import eslintPluginVue from "eslint-plugin-vue";
|
|
8
8
|
import eslintPluginNuxtLinkChecker from "nuxt-link-checker/eslint";
|
|
9
9
|
import eslintPluginNuxt from "@nuxt/eslint-plugin";
|
|
10
|
-
|
|
10
|
+
// src/configs/nuxt.ts
|
|
11
11
|
const baseVueConfig = eslintPluginVue.configs["flat/base"].find((config) => config.languageOptions?.parser);
|
|
12
12
|
const middlewaresConfig = {
|
|
13
13
|
name: "shayanthenerd/nuxt/middlewares",
|
|
@@ -61,5 +61,4 @@ function getNuxtConfigs(options) {
|
|
|
61
61
|
serverComponentsConfig
|
|
62
62
|
];
|
|
63
63
|
}
|
|
64
|
-
//#endregion
|
|
65
64
|
export { getNuxtConfigs };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { globs } from "../helpers/globs.mjs";
|
|
2
2
|
import { defaultOptions } from "../helpers/options/defaultOptions.mjs";
|
|
3
|
-
import { isEnabled } from "../utils/isEnabled.mjs";
|
|
4
3
|
import { getPackageJsonRules } from "../rules/packageJson.mjs";
|
|
4
|
+
import { isEnabled } from "../utils/isEnabled.mjs";
|
|
5
5
|
import { mergeConfigs } from "eslint-flat-config-utils";
|
|
6
6
|
import eslintPluginPackageJson from "eslint-plugin-package-json";
|
|
7
|
-
|
|
7
|
+
// src/configs/packageJson.ts
|
|
8
8
|
function getPackageJsonConfig(options) {
|
|
9
9
|
const { packageJson } = options.configs;
|
|
10
10
|
const { overrides } = isEnabled(packageJson) ? packageJson : defaultOptions.configs.packageJson;
|
|
@@ -17,5 +17,4 @@ function getPackageJsonConfig(options) {
|
|
|
17
17
|
};
|
|
18
18
|
return mergeConfigs(packageJsonConfig, overrides);
|
|
19
19
|
}
|
|
20
|
-
//#endregion
|
|
21
20
|
export { getPackageJsonConfig };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { globs } from "../helpers/globs.mjs";
|
|
2
2
|
import { defaultOptions } from "../helpers/options/defaultOptions.mjs";
|
|
3
|
+
import { getPerfectionistRules } from "../rules/perfectionist.mjs";
|
|
3
4
|
import { isEnabled } from "../utils/isEnabled.mjs";
|
|
4
5
|
import { isTruthy } from "../utils/isTruthy.mjs";
|
|
5
|
-
import { getPerfectionistRules } from "../rules/perfectionist.mjs";
|
|
6
6
|
import { mergeConfigs } from "eslint-flat-config-utils";
|
|
7
7
|
import eslintPluginPerfectionist from "eslint-plugin-perfectionist";
|
|
8
|
-
|
|
8
|
+
// src/configs/perfectionist.ts
|
|
9
9
|
function getPerfectionistConfig(options) {
|
|
10
10
|
const { vue, astro, perfectionist } = options.configs;
|
|
11
11
|
const { sortType, overrides } = isEnabled(perfectionist) ? perfectionist : defaultOptions.configs.perfectionist;
|
|
@@ -30,5 +30,4 @@ function getPerfectionistConfig(options) {
|
|
|
30
30
|
};
|
|
31
31
|
return mergeConfigs(perfectionistConfig, overrides);
|
|
32
32
|
}
|
|
33
|
-
//#endregion
|
|
34
33
|
export { getPerfectionistConfig };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { globs } from "../helpers/globs.mjs";
|
|
2
2
|
import { defaultOptions } from "../helpers/options/defaultOptions.mjs";
|
|
3
|
-
import { isEnabled } from "../utils/isEnabled.mjs";
|
|
4
3
|
import { getPlaywrightRules } from "../rules/playwright.mjs";
|
|
4
|
+
import { isEnabled } from "../utils/isEnabled.mjs";
|
|
5
5
|
import { mergeConfigs } from "eslint-flat-config-utils";
|
|
6
6
|
import eslintPluginPlaywright from "eslint-plugin-playwright";
|
|
7
|
-
|
|
7
|
+
// src/configs/playwright.ts
|
|
8
8
|
function getPlaywrightConfig(options) {
|
|
9
9
|
const { playwright } = options.configs.test;
|
|
10
10
|
const { overrides } = isEnabled(playwright) ? playwright : defaultOptions.configs.test.playwright;
|
|
@@ -17,5 +17,4 @@ function getPlaywrightConfig(options) {
|
|
|
17
17
|
};
|
|
18
18
|
return mergeConfigs(playwrightConfig, overrides);
|
|
19
19
|
}
|
|
20
|
-
//#endregion
|
|
21
20
|
export { getPlaywrightConfig };
|
package/dist/configs/promise.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { globs } from "../helpers/globs.mjs";
|
|
2
2
|
import { defaultOptions } from "../helpers/options/defaultOptions.mjs";
|
|
3
|
+
import { getPromiseRules } from "../rules/promise.mjs";
|
|
3
4
|
import { isEnabled } from "../utils/isEnabled.mjs";
|
|
4
5
|
import { isTruthy } from "../utils/isTruthy.mjs";
|
|
5
|
-
import { getPromiseRules } from "../rules/promise.mjs";
|
|
6
6
|
import { mergeConfigs } from "eslint-flat-config-utils";
|
|
7
7
|
import eslintPluginPromise from "eslint-plugin-promise";
|
|
8
|
-
|
|
8
|
+
// src/configs/promise.ts
|
|
9
9
|
function getPromiseConfig(options) {
|
|
10
10
|
const { vue, astro, promise } = options.configs;
|
|
11
11
|
const { overrides } = isEnabled(promise) ? promise : defaultOptions.configs.promise;
|
|
@@ -22,5 +22,4 @@ function getPromiseConfig(options) {
|
|
|
22
22
|
};
|
|
23
23
|
return mergeConfigs(promiseConfig, overrides);
|
|
24
24
|
}
|
|
25
|
-
//#endregion
|
|
26
25
|
export { getPromiseConfig };
|
package/dist/configs/react.mjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { globs } from "../helpers/globs.mjs";
|
|
2
2
|
import { defaultOptions } from "../helpers/options/defaultOptions.mjs";
|
|
3
|
-
import { isEnabled } from "../utils/isEnabled.mjs";
|
|
4
3
|
import { getReactRules } from "../rules/react.mjs";
|
|
4
|
+
import { isEnabled } from "../utils/isEnabled.mjs";
|
|
5
5
|
import { mergeConfigs } from "eslint-flat-config-utils";
|
|
6
6
|
import eslintPluginUnicorn from "eslint-plugin-unicorn";
|
|
7
7
|
import eslintPluginJsxA11yX from "eslint-plugin-jsx-a11y-x";
|
|
8
8
|
import eslintPluginReact from "@eslint-react/eslint-plugin";
|
|
9
9
|
import eslintPluginHtmlReact from "@html-eslint/eslint-plugin-react";
|
|
10
|
-
|
|
10
|
+
// src/configs/react.ts
|
|
11
11
|
function getReactConfig(options) {
|
|
12
12
|
const { react, unicorn } = options.configs;
|
|
13
13
|
const { overrides, accessibility } = isEnabled(react) ? react : defaultOptions.configs.react;
|
|
@@ -24,5 +24,4 @@ function getReactConfig(options) {
|
|
|
24
24
|
};
|
|
25
25
|
return mergeConfigs(reactConfig, overrides);
|
|
26
26
|
}
|
|
27
|
-
//#endregion
|
|
28
27
|
export { getReactConfig };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { globs } from "../helpers/globs.mjs";
|
|
2
2
|
import { defaultOptions } from "../helpers/options/defaultOptions.mjs";
|
|
3
|
-
import { isEnabled } from "../utils/isEnabled.mjs";
|
|
4
3
|
import { getStorybookRules } from "../rules/storybook.mjs";
|
|
4
|
+
import { isEnabled } from "../utils/isEnabled.mjs";
|
|
5
5
|
import { mergeConfigs } from "eslint-flat-config-utils";
|
|
6
6
|
import eslintPluginStorybook from "eslint-plugin-storybook";
|
|
7
|
-
|
|
7
|
+
// src/configs/storybook.ts
|
|
8
8
|
function getStorybookConfig(options) {
|
|
9
9
|
const { storybook } = options.configs.test;
|
|
10
10
|
const { overrides } = isEnabled(storybook) ? storybook : defaultOptions.configs.test.storybook;
|
|
@@ -16,5 +16,4 @@ function getStorybookConfig(options) {
|
|
|
16
16
|
};
|
|
17
17
|
return mergeConfigs(storybookConfig, overrides);
|
|
18
18
|
}
|
|
19
|
-
//#endregion
|
|
20
19
|
export { getStorybookConfig };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { globs } from "../helpers/globs.mjs";
|
|
2
2
|
import { defaultOptions } from "../helpers/options/defaultOptions.mjs";
|
|
3
|
+
import { getStylisticRules } from "../rules/stylistic.mjs";
|
|
3
4
|
import { isEnabled } from "../utils/isEnabled.mjs";
|
|
4
5
|
import { isTruthy } from "../utils/isTruthy.mjs";
|
|
5
|
-
import { getStylisticRules } from "../rules/stylistic.mjs";
|
|
6
6
|
import { mergeConfigs } from "eslint-flat-config-utils";
|
|
7
7
|
import eslintPluginStylistic from "@stylistic/eslint-plugin";
|
|
8
|
-
|
|
8
|
+
// src/configs/stylistic.ts
|
|
9
9
|
function getStylisticConfig(options) {
|
|
10
10
|
const { vue, astro, stylistic } = options.configs;
|
|
11
11
|
const { overrides } = isEnabled(stylistic) ? stylistic : defaultOptions.configs.stylistic;
|
|
@@ -22,5 +22,4 @@ function getStylisticConfig(options) {
|
|
|
22
22
|
};
|
|
23
23
|
return mergeConfigs(stylisticConfig, overrides);
|
|
24
24
|
}
|
|
25
|
-
//#endregion
|
|
26
25
|
export { getStylisticConfig };
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { globs } from "../helpers/globs.mjs";
|
|
2
2
|
import { defaultOptions } from "../helpers/options/defaultOptions.mjs";
|
|
3
|
+
import { getTailwindRules } from "../rules/tailwind.mjs";
|
|
3
4
|
import { isEnabled } from "../utils/isEnabled.mjs";
|
|
4
5
|
import { isTruthy } from "../utils/isTruthy.mjs";
|
|
5
|
-
import { getTailwindRules } from "../rules/tailwind.mjs";
|
|
6
6
|
import { mergeConfigs } from "eslint-flat-config-utils";
|
|
7
7
|
import path from "node:path";
|
|
8
8
|
import eslintPluginTailwind from "eslint-plugin-better-tailwindcss";
|
|
9
9
|
import { getDefaultSelectors } from "eslint-plugin-better-tailwindcss/defaults";
|
|
10
10
|
import { MatcherType, SelectorKind } from "eslint-plugin-better-tailwindcss/types";
|
|
11
|
-
|
|
11
|
+
// src/configs/tailwind.ts
|
|
12
12
|
const astroAttributes = {
|
|
13
13
|
kind: SelectorKind.Attribute,
|
|
14
14
|
name: "^class:list$",
|
|
@@ -82,5 +82,4 @@ function getTailwindConfig(options) {
|
|
|
82
82
|
};
|
|
83
83
|
return mergeConfigs(tailwindConfig, overrides);
|
|
84
84
|
}
|
|
85
|
-
//#endregion
|
|
86
85
|
export { getTailwindConfig };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { globs } from "../helpers/globs.mjs";
|
|
2
2
|
import { defaultOptions } from "../helpers/options/defaultOptions.mjs";
|
|
3
|
-
import { isEnabled } from "../utils/isEnabled.mjs";
|
|
4
3
|
import { getTanstackRules } from "../rules/tanstack.mjs";
|
|
4
|
+
import { isEnabled } from "../utils/isEnabled.mjs";
|
|
5
5
|
import { mergeConfigs } from "eslint-flat-config-utils";
|
|
6
6
|
import eslintPluginTanstackQuery from "@tanstack/eslint-plugin-query";
|
|
7
7
|
import eslintPluginTanstackRouter from "@tanstack/eslint-plugin-router";
|
|
8
8
|
import eslintPluginTanstackStart from "@tanstack/eslint-plugin-start";
|
|
9
|
-
|
|
9
|
+
// src/configs/tanstack.ts
|
|
10
10
|
function getTanstackConfig(options) {
|
|
11
11
|
const { tanstack } = options.configs;
|
|
12
12
|
const { overrides } = isEnabled(tanstack) ? tanstack : defaultOptions.configs.tanstack;
|
|
@@ -22,5 +22,4 @@ function getTanstackConfig(options) {
|
|
|
22
22
|
};
|
|
23
23
|
return mergeConfigs(tanstackConfig, overrides);
|
|
24
24
|
}
|
|
25
|
-
//#endregion
|
|
26
25
|
export { getTanstackConfig };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { globs } from "../helpers/globs.mjs";
|
|
2
2
|
import { defaultOptions } from "../helpers/options/defaultOptions.mjs";
|
|
3
|
+
import { getTypescriptRules } from "../rules/typescript.mjs";
|
|
3
4
|
import { isEnabled } from "../utils/isEnabled.mjs";
|
|
4
5
|
import { isTruthy } from "../utils/isTruthy.mjs";
|
|
5
|
-
import { getTypescriptRules } from "../rules/typescript.mjs";
|
|
6
6
|
import { mergeConfigs } from "eslint-flat-config-utils";
|
|
7
7
|
import { parser, plugin } from "typescript-eslint";
|
|
8
8
|
import path from "node:path";
|
|
9
|
-
|
|
9
|
+
// src/configs/typescript.ts
|
|
10
10
|
function getTypescriptConfig(options) {
|
|
11
11
|
const { tsConfig, configs: { vue, typescript } } = options;
|
|
12
12
|
const { allowedDefaultProjects: userAllowedDefaultProjects } = isEnabled(typescript) ? typescript : defaultOptions.configs.typescript;
|
|
@@ -33,5 +33,4 @@ function getTypescriptConfig(options) {
|
|
|
33
33
|
};
|
|
34
34
|
return mergeConfigs(typescriptConfig, overrides);
|
|
35
35
|
}
|
|
36
|
-
//#endregion
|
|
37
36
|
export { getTypescriptConfig };
|
package/dist/configs/unicorn.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { globs } from "../helpers/globs.mjs";
|
|
2
2
|
import { defaultOptions } from "../helpers/options/defaultOptions.mjs";
|
|
3
|
+
import { getUnicornRules } from "../rules/unicorn.mjs";
|
|
3
4
|
import { isEnabled } from "../utils/isEnabled.mjs";
|
|
4
5
|
import { isTruthy } from "../utils/isTruthy.mjs";
|
|
5
|
-
import { getUnicornRules } from "../rules/unicorn.mjs";
|
|
6
6
|
import { mergeConfigs } from "eslint-flat-config-utils";
|
|
7
7
|
import eslintPluginUnicorn from "eslint-plugin-unicorn";
|
|
8
|
-
|
|
8
|
+
// src/configs/unicorn.ts
|
|
9
9
|
function getUnicornConfig(options) {
|
|
10
10
|
const { vue, astro, unicorn } = options.configs;
|
|
11
11
|
const { overrides } = isEnabled(unicorn) ? unicorn : defaultOptions.configs.unicorn;
|
|
@@ -22,5 +22,4 @@ function getUnicornConfig(options) {
|
|
|
22
22
|
};
|
|
23
23
|
return mergeConfigs(astroConfig, overrides);
|
|
24
24
|
}
|
|
25
|
-
//#endregion
|
|
26
25
|
export { getUnicornConfig };
|
package/dist/configs/vitest.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { globs } from "../helpers/globs.mjs";
|
|
2
2
|
import { defaultOptions } from "../helpers/options/defaultOptions.mjs";
|
|
3
|
-
import { isEnabled } from "../utils/isEnabled.mjs";
|
|
4
3
|
import { getVitestRules } from "../rules/vitest.mjs";
|
|
4
|
+
import { isEnabled } from "../utils/isEnabled.mjs";
|
|
5
5
|
import { mergeConfigs } from "eslint-flat-config-utils";
|
|
6
6
|
import eslintPluginVitest from "@vitest/eslint-plugin";
|
|
7
|
-
|
|
7
|
+
// src/configs/vitest.ts
|
|
8
8
|
function getVitestConfig(options) {
|
|
9
9
|
const { vitest } = options.configs.test;
|
|
10
10
|
const { overrides } = isEnabled(vitest) ? vitest : defaultOptions.configs.test.vitest;
|
|
@@ -16,5 +16,4 @@ function getVitestConfig(options) {
|
|
|
16
16
|
};
|
|
17
17
|
return mergeConfigs(vitestConfig, overrides);
|
|
18
18
|
}
|
|
19
|
-
//#endregion
|
|
20
19
|
export { getVitestConfig };
|
package/dist/configs/vue.mjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { globs } from "../helpers/globs.mjs";
|
|
2
2
|
import { defaultOptions } from "../helpers/options/defaultOptions.mjs";
|
|
3
|
-
import { isEnabled } from "../utils/isEnabled.mjs";
|
|
4
3
|
import { getVueRules } from "../rules/vue.mjs";
|
|
4
|
+
import { isEnabled } from "../utils/isEnabled.mjs";
|
|
5
5
|
import { mergeConfigs } from "eslint-flat-config-utils";
|
|
6
6
|
import { parser } from "typescript-eslint";
|
|
7
7
|
import eslintPluginVue from "eslint-plugin-vue";
|
|
8
8
|
import eslintPluginVueAccessibility from "eslint-plugin-vuejs-accessibility";
|
|
9
|
-
|
|
9
|
+
// src/configs/vue.ts
|
|
10
10
|
const baseVueConfig = eslintPluginVue.configs["flat/base"].find((config) => config.languageOptions?.parser);
|
|
11
11
|
function getVueConfig(options) {
|
|
12
12
|
const { vue } = options.configs;
|
|
@@ -37,5 +37,4 @@ function getVueConfig(options) {
|
|
|
37
37
|
};
|
|
38
38
|
return mergeConfigs(vueConfig, overrides);
|
|
39
39
|
}
|
|
40
|
-
//#endregion
|
|
41
40
|
export { getVueConfig };
|
package/dist/configs/zod.mjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { globs } from "../helpers/globs.mjs";
|
|
2
2
|
import { defaultOptions } from "../helpers/options/defaultOptions.mjs";
|
|
3
|
+
import { getZodRules } from "../rules/zod.mjs";
|
|
3
4
|
import { isEnabled } from "../utils/isEnabled.mjs";
|
|
4
5
|
import { isTruthy } from "../utils/isTruthy.mjs";
|
|
5
|
-
import { getZodRules } from "../rules/zod.mjs";
|
|
6
6
|
import { mergeConfigs } from "eslint-flat-config-utils";
|
|
7
7
|
import eslintPluginZod from "eslint-plugin-zod";
|
|
8
8
|
import eslintPluginZodMini from "eslint-plugin-zod-mini";
|
|
9
|
-
|
|
9
|
+
// src/configs/zod.ts
|
|
10
10
|
function getZodConfig(options) {
|
|
11
11
|
const { zod, vue, astro } = options.configs;
|
|
12
12
|
const { mini, overrides } = isEnabled(zod) ? zod : defaultOptions.configs.zod;
|
|
@@ -23,5 +23,4 @@ function getZodConfig(options) {
|
|
|
23
23
|
};
|
|
24
24
|
return mergeConfigs(zodConfig, overrides);
|
|
25
25
|
}
|
|
26
|
-
//#endregion
|
|
27
26
|
export { getZodConfig };
|
package/dist/helpers/globs.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/helpers/globs.ts
|
|
2
2
|
const sourceExtensions = "?([mc])[jt]s";
|
|
3
3
|
const jsxTsxExtensions = "[jt]sx";
|
|
4
4
|
const vueSourceExtensions = `{vue,${sourceExtensions},${jsxTsxExtensions}}`;
|
|
@@ -18,5 +18,4 @@ const globs = {
|
|
|
18
18
|
test: `**/{__tests__/*,*.{test,spec,cy,bench?(mark)}.${sourceExtensions}`,
|
|
19
19
|
coverage: "**/coverage/**"
|
|
20
20
|
};
|
|
21
|
-
//#endregion
|
|
22
21
|
export { globs };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/helpers/ignores/defaultIgnorePatterns.ts
|
|
2
2
|
const defaultIgnorePatterns = [
|
|
3
3
|
"**/jspm_packages",
|
|
4
4
|
"**/pnpm-lock.yaml",
|
|
@@ -51,5 +51,4 @@ const defaultIgnorePatterns = [
|
|
|
51
51
|
"**/CODEOWNERS.md",
|
|
52
52
|
"**/CODE_OF_CONDUCT.md"
|
|
53
53
|
];
|
|
54
|
-
//#endregion
|
|
55
54
|
export { defaultIgnorePatterns };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defaultIgnorePatterns } from "./defaultIgnorePatterns.mjs";
|
|
2
2
|
import { resolveGitignorePatterns } from "./resolveGitignorePatterns.mjs";
|
|
3
|
-
|
|
3
|
+
// src/helpers/ignores/getIgnorePatterns.ts
|
|
4
4
|
function getIgnorePatterns({ patterns, gitignore }) {
|
|
5
5
|
if (gitignore) {
|
|
6
6
|
const gitignorePatterns = resolveGitignorePatterns(gitignore);
|
|
@@ -9,5 +9,4 @@ function getIgnorePatterns({ patterns, gitignore }) {
|
|
|
9
9
|
if (patterns.length > 0) defaultIgnorePatterns.push(...patterns);
|
|
10
10
|
return [...new Set(defaultIgnorePatterns)];
|
|
11
11
|
}
|
|
12
|
-
//#endregion
|
|
13
12
|
export { getIgnorePatterns };
|
|
@@ -2,7 +2,7 @@ import { includeIgnoreFile } from "eslint/config";
|
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import fs from "node:fs";
|
|
4
4
|
import { styleText } from "node:util";
|
|
5
|
-
|
|
5
|
+
// src/helpers/ignores/resolveGitignorePatterns.ts
|
|
6
6
|
const warningMessage = styleText("yellow", "⚠ Warning:");
|
|
7
7
|
const fallbackMessage = `Falling back to default ignore patterns. You can suppress this warning by setting ${styleText("bgBlack", " gitignore: false ")} in the config.`;
|
|
8
8
|
function resolveGitignorePatterns(gitignorePath) {
|
|
@@ -19,5 +19,4 @@ function resolveGitignorePatterns(gitignorePath) {
|
|
|
19
19
|
else console.warn(warningMessage, `No patterns found in .gitignore file at "${styledGitignorePath}".`, fallbackMessage);
|
|
20
20
|
return gitignorePatterns;
|
|
21
21
|
}
|
|
22
|
-
//#endregion
|
|
23
22
|
export { resolveGitignorePatterns };
|
|
@@ -2,7 +2,7 @@ import { defaultOptions } from "./options/defaultOptions.mjs";
|
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { styleText } from "node:util";
|
|
4
4
|
import { isPackageExists } from "local-pkg";
|
|
5
|
-
|
|
5
|
+
// src/helpers/isPackageDetected.ts
|
|
6
6
|
const detectedPackages = [];
|
|
7
7
|
function logDetectedPackages(disabledConfigs) {
|
|
8
8
|
const nonDisabledDetectedPackages = detectedPackages.filter((packageName) => !disabledConfigs[packageName]);
|
|
@@ -18,5 +18,4 @@ function isPackageDetected(packageName, options) {
|
|
|
18
18
|
if (autoDetectDeps === "verbose" && isPackageInstalled) detectedPackages.push(packageName);
|
|
19
19
|
return isPackageInstalled;
|
|
20
20
|
}
|
|
21
|
-
//#endregion
|
|
22
21
|
export { isPackageDetected, logDetectedPackages };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/helpers/options/defaultOptions.ts
|
|
2
2
|
const defaultOptions = {
|
|
3
3
|
autoDetectDeps: true,
|
|
4
4
|
env: "browser",
|
|
@@ -249,5 +249,4 @@ const defaultOptions = {
|
|
|
249
249
|
}
|
|
250
250
|
}
|
|
251
251
|
};
|
|
252
|
-
//#endregion
|
|
253
252
|
export { defaultOptions };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { isPackageDetected, logDetectedPackages } from "../isPackageDetected.mjs";
|
|
1
2
|
import { defaultOptions } from "./defaultOptions.mjs";
|
|
2
3
|
import { isEnabled } from "../../utils/isEnabled.mjs";
|
|
3
|
-
|
|
4
|
-
//#region src/helpers/options/enableDetectedConfigs.ts
|
|
4
|
+
// src/helpers/options/enableDetectedConfigs.ts
|
|
5
5
|
function enableDetectedConfigs(options) {
|
|
6
6
|
const explicitlyDisabledConfigs = {
|
|
7
7
|
"typescript": options.configs?.typescript === false,
|
|
@@ -107,5 +107,4 @@ function enableDetectedConfigs(options) {
|
|
|
107
107
|
if (options.autoDetectDeps === "verbose") logDetectedPackages(explicitlyDisabledConfigs);
|
|
108
108
|
return options;
|
|
109
109
|
}
|
|
110
|
-
//#endregion
|
|
111
110
|
export { enableDetectedConfigs };
|