@shayanthenerd/eslint-config 0.1.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/LICENSE +21 -0
- package/README.md +496 -0
- package/dist/_virtual/rolldown_runtime.cjs +30 -0
- package/dist/configs/base.cjs +44 -0
- package/dist/configs/base.js +43 -0
- package/dist/configs/commons.cjs +26 -0
- package/dist/configs/commons.js +25 -0
- package/dist/configs/css.cjs +29 -0
- package/dist/configs/css.js +28 -0
- package/dist/configs/cypress.cjs +23 -0
- package/dist/configs/cypress.js +22 -0
- package/dist/configs/html.cjs +23 -0
- package/dist/configs/html.js +22 -0
- package/dist/configs/importX.cjs +26 -0
- package/dist/configs/importX.js +25 -0
- package/dist/configs/nuxtMultiRootTemplate.cjs +14 -0
- package/dist/configs/nuxtMultiRootTemplate.js +14 -0
- package/dist/configs/oxlintOverrides.cjs +49 -0
- package/dist/configs/oxlintOverrides.js +48 -0
- package/dist/configs/perfectionist.cjs +24 -0
- package/dist/configs/perfectionist.js +23 -0
- package/dist/configs/playwright.cjs +23 -0
- package/dist/configs/playwright.js +22 -0
- package/dist/configs/storybook.cjs +24 -0
- package/dist/configs/storybook.js +23 -0
- package/dist/configs/stylistic.cjs +23 -0
- package/dist/configs/stylistic.js +22 -0
- package/dist/configs/tailwind.cjs +43 -0
- package/dist/configs/tailwind.js +42 -0
- package/dist/configs/typescript.cjs +31 -0
- package/dist/configs/typescript.js +30 -0
- package/dist/configs/vitest.cjs +23 -0
- package/dist/configs/vitest.js +22 -0
- package/dist/configs/vue.cjs +35 -0
- package/dist/configs/vue.js +34 -0
- package/dist/configs/vueComponentNames.cjs +19 -0
- package/dist/configs/vueComponentNames.js +19 -0
- package/dist/index.cjs +55 -0
- package/dist/index.d.cts +16 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.js +54 -0
- package/dist/oxlint.config.jsonc +192 -0
- package/dist/prettier.config.js +42 -0
- package/dist/rules/css.cjs +65 -0
- package/dist/rules/css.js +65 -0
- package/dist/rules/cypress.cjs +16 -0
- package/dist/rules/cypress.js +15 -0
- package/dist/rules/html.cjs +53 -0
- package/dist/rules/html.js +53 -0
- package/dist/rules/importX.cjs +51 -0
- package/dist/rules/importX.js +50 -0
- package/dist/rules/javascript.cjs +164 -0
- package/dist/rules/javascript.js +163 -0
- package/dist/rules/perfectionist.cjs +73 -0
- package/dist/rules/perfectionist.js +73 -0
- package/dist/rules/playwright.cjs +28 -0
- package/dist/rules/playwright.js +27 -0
- package/dist/rules/storybook.cjs +16 -0
- package/dist/rules/storybook.js +15 -0
- package/dist/rules/stylistic.cjs +160 -0
- package/dist/rules/stylistic.js +160 -0
- package/dist/rules/tailwind.cjs +36 -0
- package/dist/rules/tailwind.js +36 -0
- package/dist/rules/typescript.cjs +62 -0
- package/dist/rules/typescript.js +62 -0
- package/dist/rules/vitest.cjs +47 -0
- package/dist/rules/vitest.js +46 -0
- package/dist/rules/vue.cjs +169 -0
- package/dist/rules/vue.js +169 -0
- package/dist/rules/vueAccessibility.cjs +23 -0
- package/dist/rules/vueAccessibility.js +23 -0
- package/dist/types/configOptions/base.d.cts +47 -0
- package/dist/types/configOptions/base.d.ts +47 -0
- package/dist/types/configOptions/css.d.cts +27 -0
- package/dist/types/configOptions/css.d.ts +27 -0
- package/dist/types/configOptions/html.d.cts +27 -0
- package/dist/types/configOptions/html.d.ts +27 -0
- package/dist/types/configOptions/importX.d.cts +20 -0
- package/dist/types/configOptions/importX.d.ts +20 -0
- package/dist/types/configOptions/nuxt.d.cts +42 -0
- package/dist/types/configOptions/nuxt.d.ts +42 -0
- package/dist/types/configOptions/perfectionist.d.cts +16 -0
- package/dist/types/configOptions/perfectionist.d.ts +16 -0
- package/dist/types/configOptions/stylistic.d.cts +145 -0
- package/dist/types/configOptions/stylistic.d.ts +145 -0
- package/dist/types/configOptions/tailwind.d.cts +46 -0
- package/dist/types/configOptions/tailwind.d.ts +46 -0
- package/dist/types/configOptions/test.d.cts +55 -0
- package/dist/types/configOptions/test.d.ts +55 -0
- package/dist/types/configOptions/typescript.d.cts +36 -0
- package/dist/types/configOptions/typescript.d.ts +36 -0
- package/dist/types/configOptions/vue.d.cts +211 -0
- package/dist/types/configOptions/vue.d.ts +211 -0
- package/dist/types/configOptions/vueAccessibility.d.cts +34 -0
- package/dist/types/configOptions/vueAccessibility.d.ts +34 -0
- package/dist/types/eslint-schema.d.cts +13258 -0
- package/dist/types/eslint-schema.d.ts +13258 -0
- package/dist/types/eslintRules.d.cts +12 -0
- package/dist/types/eslintRules.d.ts +12 -0
- package/dist/types/helpers.d.cts +5 -0
- package/dist/types/helpers.d.ts +5 -0
- package/dist/types/index.d.cts +360 -0
- package/dist/types/index.d.ts +360 -0
- package/dist/utils/globs.cjs +31 -0
- package/dist/utils/globs.js +30 -0
- package/dist/utils/ignores/defaultIgnorePatterns.cjs +58 -0
- package/dist/utils/ignores/defaultIgnorePatterns.js +57 -0
- package/dist/utils/ignores/getIgnorePatterns.cjs +16 -0
- package/dist/utils/ignores/getIgnorePatterns.js +16 -0
- package/dist/utils/ignores/resolveGitignorePatterns.cjs +27 -0
- package/dist/utils/ignores/resolveGitignorePatterns.js +26 -0
- package/dist/utils/isEmptyString.cjs +8 -0
- package/dist/utils/isEmptyString.js +7 -0
- package/dist/utils/isEnabled.cjs +8 -0
- package/dist/utils/isEnabled.js +7 -0
- package/dist/utils/isPackageDetected.cjs +22 -0
- package/dist/utils/isPackageDetected.js +20 -0
- package/dist/utils/options/defaultOptions.cjs +168 -0
- package/dist/utils/options/defaultOptions.js +167 -0
- package/dist/utils/options/enableDetectedConfigs.cjs +36 -0
- package/dist/utils/options/enableDetectedConfigs.js +36 -0
- package/dist/utils/options/mergeWithDefaults.cjs +22 -0
- package/dist/utils/options/mergeWithDefaults.js +21 -0
- package/dist/utils/vue/getRestrictedVueElements.cjs +28 -0
- package/dist/utils/vue/getRestrictedVueElements.js +27 -0
- package/dist/utils/vue/getRestrictedVueInputs.cjs +24 -0
- package/dist/utils/vue/getRestrictedVueInputs.js +23 -0
- package/package.json +130 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { globs } from "../utils/globs.js";
|
|
2
|
+
import typescriptESLint from "typescript-eslint";
|
|
3
|
+
|
|
4
|
+
//#region src/configs/commons.ts
|
|
5
|
+
function getCommonsConfig(options) {
|
|
6
|
+
const commonsConfig = {
|
|
7
|
+
name: "shayanthenerd/commons",
|
|
8
|
+
files: [globs.commons],
|
|
9
|
+
ignores: [globs.commonsIgnore],
|
|
10
|
+
plugins: { "@typescript-eslint": typescriptESLint.plugin },
|
|
11
|
+
rules: {
|
|
12
|
+
"@typescript-eslint/explicit-function-return-type": "error",
|
|
13
|
+
"no-restricted-exports": [options.configs.base.preferNamedExports ? "error" : "off", { restrictDefaultExports: {
|
|
14
|
+
named: true,
|
|
15
|
+
direct: true,
|
|
16
|
+
namedFrom: true,
|
|
17
|
+
namespaceFrom: true
|
|
18
|
+
} }]
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
return commonsConfig;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
//#endregion
|
|
25
|
+
export { getCommonsConfig };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_globs = require('../utils/globs.cjs');
|
|
3
|
+
const require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_isEnabled = require('../utils/isEnabled.cjs');
|
|
4
|
+
const require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_options_defaultOptions = require('../utils/options/defaultOptions.cjs');
|
|
5
|
+
const require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_rules_css = require('../rules/css.cjs');
|
|
6
|
+
const __eslint_css = require_rolldown_runtime.__toESM(require("@eslint/css"));
|
|
7
|
+
const tailwind_csstree = require_rolldown_runtime.__toESM(require("tailwind-csstree"));
|
|
8
|
+
const eslint_flat_config_utils = require_rolldown_runtime.__toESM(require("eslint-flat-config-utils"));
|
|
9
|
+
|
|
10
|
+
//#region src/configs/css.ts
|
|
11
|
+
function getCSSConfig(options) {
|
|
12
|
+
const { css } = options.configs;
|
|
13
|
+
const { overrides } = require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_isEnabled.isEnabled(css) ? css : require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_options_defaultOptions.defaultOptions.configs.css;
|
|
14
|
+
const cssConfig = {
|
|
15
|
+
name: "shayanthenerd/css",
|
|
16
|
+
files: [require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_globs.globs.css],
|
|
17
|
+
extends: [__eslint_css.default.configs.recommended],
|
|
18
|
+
language: "css/css",
|
|
19
|
+
languageOptions: {
|
|
20
|
+
tolerant: true,
|
|
21
|
+
customSyntax: options.configs.tailwind ? tailwind_csstree.tailwind4 : void 0
|
|
22
|
+
},
|
|
23
|
+
rules: require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_rules_css.getCSSRules(options)
|
|
24
|
+
};
|
|
25
|
+
return (0, eslint_flat_config_utils.mergeConfigs)(cssConfig, overrides);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
//#endregion
|
|
29
|
+
exports.getCSSConfig = getCSSConfig;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { globs } from "../utils/globs.js";
|
|
2
|
+
import { isEnabled } from "../utils/isEnabled.js";
|
|
3
|
+
import { defaultOptions } from "../utils/options/defaultOptions.js";
|
|
4
|
+
import { getCSSRules } from "../rules/css.js";
|
|
5
|
+
import eslintCSS from "@eslint/css";
|
|
6
|
+
import { tailwind4 } from "tailwind-csstree";
|
|
7
|
+
import { mergeConfigs } from "eslint-flat-config-utils";
|
|
8
|
+
|
|
9
|
+
//#region src/configs/css.ts
|
|
10
|
+
function getCSSConfig(options) {
|
|
11
|
+
const { css } = options.configs;
|
|
12
|
+
const { overrides } = isEnabled(css) ? css : defaultOptions.configs.css;
|
|
13
|
+
const cssConfig = {
|
|
14
|
+
name: "shayanthenerd/css",
|
|
15
|
+
files: [globs.css],
|
|
16
|
+
extends: [eslintCSS.configs.recommended],
|
|
17
|
+
language: "css/css",
|
|
18
|
+
languageOptions: {
|
|
19
|
+
tolerant: true,
|
|
20
|
+
customSyntax: options.configs.tailwind ? tailwind4 : void 0
|
|
21
|
+
},
|
|
22
|
+
rules: getCSSRules(options)
|
|
23
|
+
};
|
|
24
|
+
return mergeConfigs(cssConfig, overrides);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
//#endregion
|
|
28
|
+
export { getCSSConfig };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_globs = require('../utils/globs.cjs');
|
|
3
|
+
const require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_isEnabled = require('../utils/isEnabled.cjs');
|
|
4
|
+
const require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_options_defaultOptions = require('../utils/options/defaultOptions.cjs');
|
|
5
|
+
const require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_rules_cypress = require('../rules/cypress.cjs');
|
|
6
|
+
const eslint_flat_config_utils = require_rolldown_runtime.__toESM(require("eslint-flat-config-utils"));
|
|
7
|
+
const eslint_plugin_cypress = require_rolldown_runtime.__toESM(require("eslint-plugin-cypress"));
|
|
8
|
+
|
|
9
|
+
//#region src/configs/cypress.ts
|
|
10
|
+
function getCypressConfig(options) {
|
|
11
|
+
const { cypress } = options.configs.test;
|
|
12
|
+
const { overrides } = require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_isEnabled.isEnabled(cypress) ? cypress : require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_options_defaultOptions.defaultOptions.configs.test.cypress;
|
|
13
|
+
const cypressConfig = {
|
|
14
|
+
name: "shayanthenerd/cypress",
|
|
15
|
+
files: [require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_globs.globs.test],
|
|
16
|
+
extends: [eslint_plugin_cypress.default.configs.recommended],
|
|
17
|
+
rules: require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_rules_cypress.getCypressRules()
|
|
18
|
+
};
|
|
19
|
+
return (0, eslint_flat_config_utils.mergeConfigs)(cypressConfig, overrides);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
//#endregion
|
|
23
|
+
exports.getCypressConfig = getCypressConfig;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { globs } from "../utils/globs.js";
|
|
2
|
+
import { isEnabled } from "../utils/isEnabled.js";
|
|
3
|
+
import { defaultOptions } from "../utils/options/defaultOptions.js";
|
|
4
|
+
import { getCypressRules } from "../rules/cypress.js";
|
|
5
|
+
import { mergeConfigs } from "eslint-flat-config-utils";
|
|
6
|
+
import eslintPluginCypress from "eslint-plugin-cypress";
|
|
7
|
+
|
|
8
|
+
//#region src/configs/cypress.ts
|
|
9
|
+
function getCypressConfig(options) {
|
|
10
|
+
const { cypress } = options.configs.test;
|
|
11
|
+
const { overrides } = isEnabled(cypress) ? cypress : defaultOptions.configs.test.cypress;
|
|
12
|
+
const cypressConfig = {
|
|
13
|
+
name: "shayanthenerd/cypress",
|
|
14
|
+
files: [globs.test],
|
|
15
|
+
extends: [eslintPluginCypress.configs.recommended],
|
|
16
|
+
rules: getCypressRules()
|
|
17
|
+
};
|
|
18
|
+
return mergeConfigs(cypressConfig, overrides);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
//#endregion
|
|
22
|
+
export { getCypressConfig };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_globs = require('../utils/globs.cjs');
|
|
3
|
+
const require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_isEnabled = require('../utils/isEnabled.cjs');
|
|
4
|
+
const require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_options_defaultOptions = require('../utils/options/defaultOptions.cjs');
|
|
5
|
+
const require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_rules_html = require('../rules/html.cjs');
|
|
6
|
+
const eslint_flat_config_utils = require_rolldown_runtime.__toESM(require("eslint-flat-config-utils"));
|
|
7
|
+
const __html_eslint_eslint_plugin = require_rolldown_runtime.__toESM(require("@html-eslint/eslint-plugin"));
|
|
8
|
+
|
|
9
|
+
//#region src/configs/html.ts
|
|
10
|
+
function getHTMLConfig(options) {
|
|
11
|
+
const { html } = options.configs;
|
|
12
|
+
const { overrides } = require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_isEnabled.isEnabled(html) ? html : require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_options_defaultOptions.defaultOptions.configs.html;
|
|
13
|
+
const htmlConfig = {
|
|
14
|
+
name: "shayanthenerd/html",
|
|
15
|
+
files: [require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_globs.globs.html],
|
|
16
|
+
extends: [__html_eslint_eslint_plugin.default.configs["flat/recommended"]],
|
|
17
|
+
rules: require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_rules_html.getHTMLRules(options)
|
|
18
|
+
};
|
|
19
|
+
return (0, eslint_flat_config_utils.mergeConfigs)(htmlConfig, overrides);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
//#endregion
|
|
23
|
+
exports.getHTMLConfig = getHTMLConfig;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { globs } from "../utils/globs.js";
|
|
2
|
+
import { isEnabled } from "../utils/isEnabled.js";
|
|
3
|
+
import { defaultOptions } from "../utils/options/defaultOptions.js";
|
|
4
|
+
import { getHTMLRules } from "../rules/html.js";
|
|
5
|
+
import { mergeConfigs } from "eslint-flat-config-utils";
|
|
6
|
+
import eslintPluginHTML from "@html-eslint/eslint-plugin";
|
|
7
|
+
|
|
8
|
+
//#region src/configs/html.ts
|
|
9
|
+
function getHTMLConfig(options) {
|
|
10
|
+
const { html } = options.configs;
|
|
11
|
+
const { overrides } = isEnabled(html) ? html : defaultOptions.configs.html;
|
|
12
|
+
const htmlConfig = {
|
|
13
|
+
name: "shayanthenerd/html",
|
|
14
|
+
files: [globs.html],
|
|
15
|
+
extends: [eslintPluginHTML.configs["flat/recommended"]],
|
|
16
|
+
rules: getHTMLRules(options)
|
|
17
|
+
};
|
|
18
|
+
return mergeConfigs(htmlConfig, overrides);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
//#endregion
|
|
22
|
+
export { getHTMLConfig };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_globs = require('../utils/globs.cjs');
|
|
3
|
+
const require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_isEnabled = require('../utils/isEnabled.cjs');
|
|
4
|
+
const require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_options_defaultOptions = require('../utils/options/defaultOptions.cjs');
|
|
5
|
+
const require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_rules_importX = require('../rules/importX.cjs');
|
|
6
|
+
const eslint_flat_config_utils = require_rolldown_runtime.__toESM(require("eslint-flat-config-utils"));
|
|
7
|
+
const eslint_plugin_import_x = require_rolldown_runtime.__toESM(require("eslint-plugin-import-x"));
|
|
8
|
+
const eslint_plugin_unused_imports = require_rolldown_runtime.__toESM(require("eslint-plugin-unused-imports"));
|
|
9
|
+
|
|
10
|
+
//#region src/configs/importX.ts
|
|
11
|
+
function getImportXConfig(options) {
|
|
12
|
+
const { vue, importX, typescript } = options.configs;
|
|
13
|
+
const { overrides } = require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_isEnabled.isEnabled(importX) ? importX : require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_options_defaultOptions.defaultOptions.configs.importX;
|
|
14
|
+
const importXConfig = {
|
|
15
|
+
name: "shayanthenerd/import-x",
|
|
16
|
+
files: [require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_globs.globs.src, vue ? require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_globs.globs.vue : ""],
|
|
17
|
+
extends: [eslint_plugin_import_x.default.flatConfigs.recommended, typescript ? eslint_plugin_import_x.default.flatConfigs.typescript : {}],
|
|
18
|
+
plugins: { "unused-imports": eslint_plugin_unused_imports.default },
|
|
19
|
+
settings: { "import-x/extensions": vue ? [".vue"] : void 0 },
|
|
20
|
+
rules: require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_rules_importX.getImportXRules(options)
|
|
21
|
+
};
|
|
22
|
+
return (0, eslint_flat_config_utils.mergeConfigs)(importXConfig, overrides);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
//#endregion
|
|
26
|
+
exports.getImportXConfig = getImportXConfig;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { globs } from "../utils/globs.js";
|
|
2
|
+
import { isEnabled } from "../utils/isEnabled.js";
|
|
3
|
+
import { defaultOptions } from "../utils/options/defaultOptions.js";
|
|
4
|
+
import { getImportXRules } from "../rules/importX.js";
|
|
5
|
+
import { mergeConfigs } from "eslint-flat-config-utils";
|
|
6
|
+
import eslintPluginImportX from "eslint-plugin-import-x";
|
|
7
|
+
import eslintPluginUnusedImports from "eslint-plugin-unused-imports";
|
|
8
|
+
|
|
9
|
+
//#region src/configs/importX.ts
|
|
10
|
+
function getImportXConfig(options) {
|
|
11
|
+
const { vue, importX, typescript } = options.configs;
|
|
12
|
+
const { overrides } = isEnabled(importX) ? importX : defaultOptions.configs.importX;
|
|
13
|
+
const importXConfig = {
|
|
14
|
+
name: "shayanthenerd/import-x",
|
|
15
|
+
files: [globs.src, vue ? globs.vue : ""],
|
|
16
|
+
extends: [eslintPluginImportX.flatConfigs.recommended, typescript ? eslintPluginImportX.flatConfigs.typescript : {}],
|
|
17
|
+
plugins: { "unused-imports": eslintPluginUnusedImports },
|
|
18
|
+
settings: { "import-x/extensions": vue ? [".vue"] : void 0 },
|
|
19
|
+
rules: getImportXRules(options)
|
|
20
|
+
};
|
|
21
|
+
return mergeConfigs(importXConfig, overrides);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
//#endregion
|
|
25
|
+
export { getImportXConfig };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
const require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_globs = require('../utils/globs.cjs');
|
|
2
|
+
|
|
3
|
+
//#region src/configs/nuxtMultiRootTemplate.ts
|
|
4
|
+
function getNuxtMultiRootTemplateConfig() {
|
|
5
|
+
const nuxtMultiRootTemplateConfig = {
|
|
6
|
+
name: "shayanthenerd/nuxt/allow-multiple-template-root",
|
|
7
|
+
files: [require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_globs.globs.vueMultiRootTemplate],
|
|
8
|
+
rules: { "vue/no-multiple-template-root": "off" }
|
|
9
|
+
};
|
|
10
|
+
return nuxtMultiRootTemplateConfig;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
//#endregion
|
|
14
|
+
exports.getNuxtMultiRootTemplateConfig = getNuxtMultiRootTemplateConfig;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { globs } from "../utils/globs.js";
|
|
2
|
+
|
|
3
|
+
//#region src/configs/nuxtMultiRootTemplate.ts
|
|
4
|
+
function getNuxtMultiRootTemplateConfig() {
|
|
5
|
+
const nuxtMultiRootTemplateConfig = {
|
|
6
|
+
name: "shayanthenerd/nuxt/allow-multiple-template-root",
|
|
7
|
+
files: [globs.vueMultiRootTemplate],
|
|
8
|
+
rules: { "vue/no-multiple-template-root": "off" }
|
|
9
|
+
};
|
|
10
|
+
return nuxtMultiRootTemplateConfig;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
//#endregion
|
|
14
|
+
export { getNuxtMultiRootTemplateConfig };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_globs = require('../utils/globs.cjs');
|
|
3
|
+
const require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_isEnabled = require('../utils/isEnabled.cjs');
|
|
4
|
+
const require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_rules_javascript = require('../rules/javascript.cjs');
|
|
5
|
+
const require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_rules_vitest = require('../rules/vitest.cjs');
|
|
6
|
+
const require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_rules_importX = require('../rules/importX.cjs');
|
|
7
|
+
const require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_rules_playwright = require('../rules/playwright.cjs');
|
|
8
|
+
const require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_rules_typescript = require('../rules/typescript.cjs');
|
|
9
|
+
const __vitest_eslint_plugin = require_rolldown_runtime.__toESM(require("@vitest/eslint-plugin"));
|
|
10
|
+
const eslint_plugin_import_x = require_rolldown_runtime.__toESM(require("eslint-plugin-import-x"));
|
|
11
|
+
const eslint_plugin_playwright = require_rolldown_runtime.__toESM(require("eslint-plugin-playwright"));
|
|
12
|
+
|
|
13
|
+
//#region src/configs/oxlintOverrides.ts
|
|
14
|
+
function getOXLintOverridesConfig(options) {
|
|
15
|
+
const { vue, importX, typescript, test: { vitest, playwright } } = options.configs;
|
|
16
|
+
const vitestRules = require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_rules_vitest.getVitestRules(options);
|
|
17
|
+
const importXRules = require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_rules_importX.getImportXRules(options);
|
|
18
|
+
const javascriptRules = require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_rules_javascript.getJavaScriptRules(options);
|
|
19
|
+
const typescriptRules = require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_rules_typescript.getTypeScriptRules(options);
|
|
20
|
+
const playwrightRules = require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_rules_playwright.getPlaywrightRules(options);
|
|
21
|
+
const oxlintOverridesConfig = {
|
|
22
|
+
name: "shayanthenerd/oxlint/overrides",
|
|
23
|
+
files: [
|
|
24
|
+
require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_globs.globs.src,
|
|
25
|
+
require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_globs.globs.commons,
|
|
26
|
+
vue ? require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_globs.globs.vue : "",
|
|
27
|
+
vitest || playwright ? require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_globs.globs.test : ""
|
|
28
|
+
],
|
|
29
|
+
plugins: {
|
|
30
|
+
"vitest": __vitest_eslint_plugin.default,
|
|
31
|
+
"import-x": eslint_plugin_import_x.default,
|
|
32
|
+
"playwright": eslint_plugin_playwright.default
|
|
33
|
+
},
|
|
34
|
+
rules: {
|
|
35
|
+
"max-depth": javascriptRules["max-depth"],
|
|
36
|
+
"func-style": javascriptRules["func-style"],
|
|
37
|
+
"max-nested-callbacks": javascriptRules["max-nested-callbacks"],
|
|
38
|
+
"@typescript-eslint/consistent-type-definitions": require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_isEnabled.isEnabled(typescript) ? typescriptRules["@typescript-eslint/consistent-type-definitions"] : "off",
|
|
39
|
+
"import-x/extensions": require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_isEnabled.isEnabled(importX) ? importXRules["import-x/extensions"] : "off",
|
|
40
|
+
"playwright/max-nested-describe": require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_isEnabled.isEnabled(playwright) ? playwrightRules["playwright/max-nested-describe"] : "off",
|
|
41
|
+
"vitest/consistent-test-it": require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_isEnabled.isEnabled(vitest) ? vitestRules["vitest/consistent-test-it"] : "off",
|
|
42
|
+
"vitest/max-nested-describe": require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_isEnabled.isEnabled(vitest) ? vitestRules["vitest/max-nested-describe"] : "off"
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
return oxlintOverridesConfig;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
//#endregion
|
|
49
|
+
exports.getOXLintOverridesConfig = getOXLintOverridesConfig;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { globs } from "../utils/globs.js";
|
|
2
|
+
import { isEnabled } from "../utils/isEnabled.js";
|
|
3
|
+
import { getJavaScriptRules } from "../rules/javascript.js";
|
|
4
|
+
import { getVitestRules } from "../rules/vitest.js";
|
|
5
|
+
import { getImportXRules } from "../rules/importX.js";
|
|
6
|
+
import { getPlaywrightRules } from "../rules/playwright.js";
|
|
7
|
+
import { getTypeScriptRules } from "../rules/typescript.js";
|
|
8
|
+
import eslintPluginVitest from "@vitest/eslint-plugin";
|
|
9
|
+
import eslintPluginImportX from "eslint-plugin-import-x";
|
|
10
|
+
import eslintPluginPlaywright from "eslint-plugin-playwright";
|
|
11
|
+
|
|
12
|
+
//#region src/configs/oxlintOverrides.ts
|
|
13
|
+
function getOXLintOverridesConfig(options) {
|
|
14
|
+
const { vue, importX, typescript, test: { vitest, playwright } } = options.configs;
|
|
15
|
+
const vitestRules = getVitestRules(options);
|
|
16
|
+
const importXRules = getImportXRules(options);
|
|
17
|
+
const javascriptRules = getJavaScriptRules(options);
|
|
18
|
+
const typescriptRules = getTypeScriptRules(options);
|
|
19
|
+
const playwrightRules = getPlaywrightRules(options);
|
|
20
|
+
const oxlintOverridesConfig = {
|
|
21
|
+
name: "shayanthenerd/oxlint/overrides",
|
|
22
|
+
files: [
|
|
23
|
+
globs.src,
|
|
24
|
+
globs.commons,
|
|
25
|
+
vue ? globs.vue : "",
|
|
26
|
+
vitest || playwright ? globs.test : ""
|
|
27
|
+
],
|
|
28
|
+
plugins: {
|
|
29
|
+
"vitest": eslintPluginVitest,
|
|
30
|
+
"import-x": eslintPluginImportX,
|
|
31
|
+
"playwright": eslintPluginPlaywright
|
|
32
|
+
},
|
|
33
|
+
rules: {
|
|
34
|
+
"max-depth": javascriptRules["max-depth"],
|
|
35
|
+
"func-style": javascriptRules["func-style"],
|
|
36
|
+
"max-nested-callbacks": javascriptRules["max-nested-callbacks"],
|
|
37
|
+
"@typescript-eslint/consistent-type-definitions": isEnabled(typescript) ? typescriptRules["@typescript-eslint/consistent-type-definitions"] : "off",
|
|
38
|
+
"import-x/extensions": isEnabled(importX) ? importXRules["import-x/extensions"] : "off",
|
|
39
|
+
"playwright/max-nested-describe": isEnabled(playwright) ? playwrightRules["playwright/max-nested-describe"] : "off",
|
|
40
|
+
"vitest/consistent-test-it": isEnabled(vitest) ? vitestRules["vitest/consistent-test-it"] : "off",
|
|
41
|
+
"vitest/max-nested-describe": isEnabled(vitest) ? vitestRules["vitest/max-nested-describe"] : "off"
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
return oxlintOverridesConfig;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
//#endregion
|
|
48
|
+
export { getOXLintOverridesConfig };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_globs = require('../utils/globs.cjs');
|
|
3
|
+
const require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_isEnabled = require('../utils/isEnabled.cjs');
|
|
4
|
+
const require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_options_defaultOptions = require('../utils/options/defaultOptions.cjs');
|
|
5
|
+
const require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_rules_perfectionist = require('../rules/perfectionist.cjs');
|
|
6
|
+
const eslint_flat_config_utils = require_rolldown_runtime.__toESM(require("eslint-flat-config-utils"));
|
|
7
|
+
const eslint_plugin_perfectionist = require_rolldown_runtime.__toESM(require("eslint-plugin-perfectionist"));
|
|
8
|
+
|
|
9
|
+
//#region src/configs/perfectionist.ts
|
|
10
|
+
function getPerfectionistConfig(options) {
|
|
11
|
+
const { vue, perfectionist } = options.configs;
|
|
12
|
+
const { sortType, overrides } = require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_isEnabled.isEnabled(perfectionist) ? perfectionist : require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_options_defaultOptions.defaultOptions.configs.perfectionist;
|
|
13
|
+
const perfectionistConfig = {
|
|
14
|
+
name: "shayanthenerd/perfectionist",
|
|
15
|
+
files: [require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_globs.globs.src, vue ? require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_globs.globs.vue : ""],
|
|
16
|
+
plugins: { perfectionist: eslint_plugin_perfectionist.default },
|
|
17
|
+
settings: { perfectionist: { type: sortType } },
|
|
18
|
+
rules: require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_rules_perfectionist.getPerfectionistRules(options)
|
|
19
|
+
};
|
|
20
|
+
return (0, eslint_flat_config_utils.mergeConfigs)(perfectionistConfig, overrides);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
//#endregion
|
|
24
|
+
exports.getPerfectionistConfig = getPerfectionistConfig;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { globs } from "../utils/globs.js";
|
|
2
|
+
import { isEnabled } from "../utils/isEnabled.js";
|
|
3
|
+
import { defaultOptions } from "../utils/options/defaultOptions.js";
|
|
4
|
+
import { getPerfectionistRules } from "../rules/perfectionist.js";
|
|
5
|
+
import { mergeConfigs } from "eslint-flat-config-utils";
|
|
6
|
+
import eslintPluginPerfectionist from "eslint-plugin-perfectionist";
|
|
7
|
+
|
|
8
|
+
//#region src/configs/perfectionist.ts
|
|
9
|
+
function getPerfectionistConfig(options) {
|
|
10
|
+
const { vue, perfectionist } = options.configs;
|
|
11
|
+
const { sortType, overrides } = isEnabled(perfectionist) ? perfectionist : defaultOptions.configs.perfectionist;
|
|
12
|
+
const perfectionistConfig = {
|
|
13
|
+
name: "shayanthenerd/perfectionist",
|
|
14
|
+
files: [globs.src, vue ? globs.vue : ""],
|
|
15
|
+
plugins: { perfectionist: eslintPluginPerfectionist },
|
|
16
|
+
settings: { perfectionist: { type: sortType } },
|
|
17
|
+
rules: getPerfectionistRules(options)
|
|
18
|
+
};
|
|
19
|
+
return mergeConfigs(perfectionistConfig, overrides);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
//#endregion
|
|
23
|
+
export { getPerfectionistConfig };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_globs = require('../utils/globs.cjs');
|
|
3
|
+
const require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_isEnabled = require('../utils/isEnabled.cjs');
|
|
4
|
+
const require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_options_defaultOptions = require('../utils/options/defaultOptions.cjs');
|
|
5
|
+
const require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_rules_playwright = require('../rules/playwright.cjs');
|
|
6
|
+
const eslint_flat_config_utils = require_rolldown_runtime.__toESM(require("eslint-flat-config-utils"));
|
|
7
|
+
const eslint_plugin_playwright = require_rolldown_runtime.__toESM(require("eslint-plugin-playwright"));
|
|
8
|
+
|
|
9
|
+
//#region src/configs/playwright.ts
|
|
10
|
+
function getPlaywrightConfig(options) {
|
|
11
|
+
const { playwright } = options.configs.test;
|
|
12
|
+
const { overrides } = require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_isEnabled.isEnabled(playwright) ? playwright : require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_options_defaultOptions.defaultOptions.configs.test.playwright;
|
|
13
|
+
const playwrightConfig = {
|
|
14
|
+
name: "shayanthenerd/playwright",
|
|
15
|
+
files: [require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_globs.globs.test],
|
|
16
|
+
extends: [eslint_plugin_playwright.default.configs["flat/recommended"]],
|
|
17
|
+
rules: require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_rules_playwright.getPlaywrightRules(options)
|
|
18
|
+
};
|
|
19
|
+
return (0, eslint_flat_config_utils.mergeConfigs)(playwrightConfig, overrides);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
//#endregion
|
|
23
|
+
exports.getPlaywrightConfig = getPlaywrightConfig;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { globs } from "../utils/globs.js";
|
|
2
|
+
import { isEnabled } from "../utils/isEnabled.js";
|
|
3
|
+
import { defaultOptions } from "../utils/options/defaultOptions.js";
|
|
4
|
+
import { getPlaywrightRules } from "../rules/playwright.js";
|
|
5
|
+
import { mergeConfigs } from "eslint-flat-config-utils";
|
|
6
|
+
import eslintPluginPlaywright from "eslint-plugin-playwright";
|
|
7
|
+
|
|
8
|
+
//#region src/configs/playwright.ts
|
|
9
|
+
function getPlaywrightConfig(options) {
|
|
10
|
+
const { playwright } = options.configs.test;
|
|
11
|
+
const { overrides } = isEnabled(playwright) ? playwright : defaultOptions.configs.test.playwright;
|
|
12
|
+
const playwrightConfig = {
|
|
13
|
+
name: "shayanthenerd/playwright",
|
|
14
|
+
files: [globs.test],
|
|
15
|
+
extends: [eslintPluginPlaywright.configs["flat/recommended"]],
|
|
16
|
+
rules: getPlaywrightRules(options)
|
|
17
|
+
};
|
|
18
|
+
return mergeConfigs(playwrightConfig, overrides);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
//#endregion
|
|
22
|
+
export { getPlaywrightConfig };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_globs = require('../utils/globs.cjs');
|
|
3
|
+
const require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_isEnabled = require('../utils/isEnabled.cjs');
|
|
4
|
+
const require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_options_defaultOptions = require('../utils/options/defaultOptions.cjs');
|
|
5
|
+
const require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_rules_storybook = require('../rules/storybook.cjs');
|
|
6
|
+
const eslint_flat_config_utils = require_rolldown_runtime.__toESM(require("eslint-flat-config-utils"));
|
|
7
|
+
const eslint_plugin_storybook = require_rolldown_runtime.__toESM(require("eslint-plugin-storybook"));
|
|
8
|
+
|
|
9
|
+
//#region src/configs/storybook.ts
|
|
10
|
+
const eslintConfigStorybook = eslint_plugin_storybook.default.configs["flat/recommended"];
|
|
11
|
+
function getStorybookConfig(options) {
|
|
12
|
+
const { storybook } = options.configs.test;
|
|
13
|
+
const { overrides } = require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_isEnabled.isEnabled(storybook) ? storybook : require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_options_defaultOptions.defaultOptions.configs.test.storybook;
|
|
14
|
+
const storybookConfig = {
|
|
15
|
+
name: "shayanthenerd/storybook",
|
|
16
|
+
files: [require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_globs.globs.storybook],
|
|
17
|
+
extends: [eslintConfigStorybook],
|
|
18
|
+
rules: require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_rules_storybook.getStorybookRules(options)
|
|
19
|
+
};
|
|
20
|
+
return (0, eslint_flat_config_utils.mergeConfigs)(storybookConfig, overrides);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
//#endregion
|
|
24
|
+
exports.getStorybookConfig = getStorybookConfig;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { globs } from "../utils/globs.js";
|
|
2
|
+
import { isEnabled } from "../utils/isEnabled.js";
|
|
3
|
+
import { defaultOptions } from "../utils/options/defaultOptions.js";
|
|
4
|
+
import { getStorybookRules } from "../rules/storybook.js";
|
|
5
|
+
import { mergeConfigs } from "eslint-flat-config-utils";
|
|
6
|
+
import eslintPluginStorybook from "eslint-plugin-storybook";
|
|
7
|
+
|
|
8
|
+
//#region src/configs/storybook.ts
|
|
9
|
+
const eslintConfigStorybook = eslintPluginStorybook.configs["flat/recommended"];
|
|
10
|
+
function getStorybookConfig(options) {
|
|
11
|
+
const { storybook } = options.configs.test;
|
|
12
|
+
const { overrides } = isEnabled(storybook) ? storybook : defaultOptions.configs.test.storybook;
|
|
13
|
+
const storybookConfig = {
|
|
14
|
+
name: "shayanthenerd/storybook",
|
|
15
|
+
files: [globs.storybook],
|
|
16
|
+
extends: [eslintConfigStorybook],
|
|
17
|
+
rules: getStorybookRules(options)
|
|
18
|
+
};
|
|
19
|
+
return mergeConfigs(storybookConfig, overrides);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
//#endregion
|
|
23
|
+
export { getStorybookConfig };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_globs = require('../utils/globs.cjs');
|
|
3
|
+
const require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_isEnabled = require('../utils/isEnabled.cjs');
|
|
4
|
+
const require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_options_defaultOptions = require('../utils/options/defaultOptions.cjs');
|
|
5
|
+
const require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_rules_stylistic = require('../rules/stylistic.cjs');
|
|
6
|
+
const eslint_flat_config_utils = require_rolldown_runtime.__toESM(require("eslint-flat-config-utils"));
|
|
7
|
+
const __stylistic_eslint_plugin = require_rolldown_runtime.__toESM(require("@stylistic/eslint-plugin"));
|
|
8
|
+
|
|
9
|
+
//#region src/configs/stylistic.ts
|
|
10
|
+
function getStylisticConfig(options) {
|
|
11
|
+
const { stylistic } = options.configs;
|
|
12
|
+
const { overrides } = require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_isEnabled.isEnabled(stylistic) ? stylistic : require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_options_defaultOptions.defaultOptions.configs.stylistic;
|
|
13
|
+
const stylisticConfig = {
|
|
14
|
+
name: "shayanthenerd/stylistic",
|
|
15
|
+
files: [require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_globs.globs.src, options.configs.vue ? require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_globs.globs.vue : ""],
|
|
16
|
+
extends: [__stylistic_eslint_plugin.default.configs.recommended],
|
|
17
|
+
rules: require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_rules_stylistic.getStylisticRules(options)
|
|
18
|
+
};
|
|
19
|
+
return (0, eslint_flat_config_utils.mergeConfigs)(stylisticConfig, overrides);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
//#endregion
|
|
23
|
+
exports.getStylisticConfig = getStylisticConfig;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { globs } from "../utils/globs.js";
|
|
2
|
+
import { isEnabled } from "../utils/isEnabled.js";
|
|
3
|
+
import { defaultOptions } from "../utils/options/defaultOptions.js";
|
|
4
|
+
import { getStylisticRules } from "../rules/stylistic.js";
|
|
5
|
+
import { mergeConfigs } from "eslint-flat-config-utils";
|
|
6
|
+
import eslintPluginStylistic from "@stylistic/eslint-plugin";
|
|
7
|
+
|
|
8
|
+
//#region src/configs/stylistic.ts
|
|
9
|
+
function getStylisticConfig(options) {
|
|
10
|
+
const { stylistic } = options.configs;
|
|
11
|
+
const { overrides } = isEnabled(stylistic) ? stylistic : defaultOptions.configs.stylistic;
|
|
12
|
+
const stylisticConfig = {
|
|
13
|
+
name: "shayanthenerd/stylistic",
|
|
14
|
+
files: [globs.src, options.configs.vue ? globs.vue : ""],
|
|
15
|
+
extends: [eslintPluginStylistic.configs.recommended],
|
|
16
|
+
rules: getStylisticRules(options)
|
|
17
|
+
};
|
|
18
|
+
return mergeConfigs(stylisticConfig, overrides);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
//#endregion
|
|
22
|
+
export { getStylisticConfig };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_globs = require('../utils/globs.cjs');
|
|
3
|
+
const require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_isEnabled = require('../utils/isEnabled.cjs');
|
|
4
|
+
const require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_options_defaultOptions = require('../utils/options/defaultOptions.cjs');
|
|
5
|
+
const require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_rules_tailwind = require('../rules/tailwind.cjs');
|
|
6
|
+
const node_path = require_rolldown_runtime.__toESM(require("node:path"));
|
|
7
|
+
const eslint_flat_config_utils = require_rolldown_runtime.__toESM(require("eslint-flat-config-utils"));
|
|
8
|
+
const eslint_plugin_vue = require_rolldown_runtime.__toESM(require("eslint-plugin-vue"));
|
|
9
|
+
const __html_eslint_eslint_plugin = require_rolldown_runtime.__toESM(require("@html-eslint/eslint-plugin"));
|
|
10
|
+
const eslint_plugin_better_tailwindcss = require_rolldown_runtime.__toESM(require("eslint-plugin-better-tailwindcss"));
|
|
11
|
+
|
|
12
|
+
//#region src/configs/tailwind.ts
|
|
13
|
+
const eslintParserHTML = __html_eslint_eslint_plugin.default.configs["flat/recommended"].languageOptions.parser;
|
|
14
|
+
const eslintParserVue = eslint_plugin_vue.default.configs["flat/recommended"].find((config) => config.name === "vue/base/setup-for-vue")?.languageOptions?.parser;
|
|
15
|
+
function getTailwindConfig(options) {
|
|
16
|
+
const { tsConfig, configs: { vue, html, tailwind } } = options;
|
|
17
|
+
const { entryPoint, config, overrides } = require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_isEnabled.isEnabled(tailwind) ? tailwind : require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_options_defaultOptions.defaultOptions.configs.tailwind;
|
|
18
|
+
const tailwindConfig = {
|
|
19
|
+
name: "shayanthenerd/tailwind",
|
|
20
|
+
files: [
|
|
21
|
+
require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_globs.globs.src,
|
|
22
|
+
html ? require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_globs.globs.html : "",
|
|
23
|
+
vue ? require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_globs.globs.vue : ""
|
|
24
|
+
],
|
|
25
|
+
plugins: { "better-tailwindcss": eslint_plugin_better_tailwindcss.default },
|
|
26
|
+
languageOptions: { parserOptions: { parser: html ? eslintParserHTML : eslintParserVue } },
|
|
27
|
+
settings: { "better-tailwindcss": {
|
|
28
|
+
entryPoint: node_path.default.resolve(entryPoint),
|
|
29
|
+
tailwindConfig: node_path.default.resolve(config),
|
|
30
|
+
tsconfig: tsConfig ? node_path.default.resolve(tsConfig.rootDir, tsConfig.filename) : void 0,
|
|
31
|
+
attributes: [["^v-bind:ui$", [{ match: "objectValues" }]], ["^(?:v-bind:)?(class|activeClass|inactiveClass)$", [
|
|
32
|
+
{ match: "strings" },
|
|
33
|
+
{ match: "objectKeys" },
|
|
34
|
+
{ match: "objectValues" }
|
|
35
|
+
]]]
|
|
36
|
+
} },
|
|
37
|
+
rules: require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_rules_tailwind.getTailwindRules(options)
|
|
38
|
+
};
|
|
39
|
+
return (0, eslint_flat_config_utils.mergeConfigs)(tailwindConfig, overrides);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
//#endregion
|
|
43
|
+
exports.getTailwindConfig = getTailwindConfig;
|