@shayanthenerd/eslint-config 0.1.0 → 0.4.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 +25 -9
- package/dist/configs/base.js +1 -1
- package/dist/configs/commons.js +3 -2
- package/dist/configs/importX.js +22 -2
- package/dist/configs/oxlintOverrides.js +3 -1
- package/dist/configs/tailwind.js +3 -3
- package/dist/configs/typescript.js +1 -1
- package/dist/prettier.config.d.ts +6 -0
- package/dist/prettier.config.js +22 -26
- package/dist/rules/importX.js +12 -12
- package/dist/rules/vue.js +4 -2
- package/dist/types/configOptions/importX.d.ts +16 -7
- package/dist/types/eslint-schema.d.ts +475 -1
- package/dist/utils/globs.js +3 -2
- package/dist/utils/options/defaultOptions.js +2 -1
- package/dist/utils/options/enableDetectedConfigs.js +8 -4
- package/package.json +30 -37
- package/dist/_virtual/rolldown_runtime.cjs +0 -30
- package/dist/configs/base.cjs +0 -44
- package/dist/configs/commons.cjs +0 -26
- package/dist/configs/css.cjs +0 -29
- package/dist/configs/cypress.cjs +0 -23
- package/dist/configs/html.cjs +0 -23
- package/dist/configs/importX.cjs +0 -26
- package/dist/configs/nuxtMultiRootTemplate.cjs +0 -14
- package/dist/configs/oxlintOverrides.cjs +0 -49
- package/dist/configs/perfectionist.cjs +0 -24
- package/dist/configs/playwright.cjs +0 -23
- package/dist/configs/storybook.cjs +0 -24
- package/dist/configs/stylistic.cjs +0 -23
- package/dist/configs/tailwind.cjs +0 -43
- package/dist/configs/typescript.cjs +0 -31
- package/dist/configs/vitest.cjs +0 -23
- package/dist/configs/vue.cjs +0 -35
- package/dist/configs/vueComponentNames.cjs +0 -19
- package/dist/index.cjs +0 -55
- package/dist/index.d.cts +0 -16
- package/dist/rules/css.cjs +0 -65
- package/dist/rules/cypress.cjs +0 -16
- package/dist/rules/html.cjs +0 -53
- package/dist/rules/importX.cjs +0 -51
- package/dist/rules/javascript.cjs +0 -164
- package/dist/rules/perfectionist.cjs +0 -73
- package/dist/rules/playwright.cjs +0 -28
- package/dist/rules/storybook.cjs +0 -16
- package/dist/rules/stylistic.cjs +0 -160
- package/dist/rules/tailwind.cjs +0 -36
- package/dist/rules/typescript.cjs +0 -62
- package/dist/rules/vitest.cjs +0 -47
- package/dist/rules/vue.cjs +0 -169
- package/dist/rules/vueAccessibility.cjs +0 -23
- package/dist/types/configOptions/base.d.cts +0 -47
- package/dist/types/configOptions/css.d.cts +0 -27
- package/dist/types/configOptions/html.d.cts +0 -27
- package/dist/types/configOptions/importX.d.cts +0 -20
- package/dist/types/configOptions/nuxt.d.cts +0 -42
- package/dist/types/configOptions/perfectionist.d.cts +0 -16
- package/dist/types/configOptions/stylistic.d.cts +0 -145
- package/dist/types/configOptions/tailwind.d.cts +0 -46
- package/dist/types/configOptions/test.d.cts +0 -55
- package/dist/types/configOptions/typescript.d.cts +0 -36
- package/dist/types/configOptions/vue.d.cts +0 -211
- package/dist/types/configOptions/vueAccessibility.d.cts +0 -34
- package/dist/types/eslint-schema.d.cts +0 -13258
- package/dist/types/eslintRules.d.cts +0 -12
- package/dist/types/helpers.d.cts +0 -5
- package/dist/types/index.d.cts +0 -360
- package/dist/utils/globs.cjs +0 -31
- package/dist/utils/ignores/defaultIgnorePatterns.cjs +0 -58
- package/dist/utils/ignores/getIgnorePatterns.cjs +0 -16
- package/dist/utils/ignores/resolveGitignorePatterns.cjs +0 -27
- package/dist/utils/isEmptyString.cjs +0 -8
- package/dist/utils/isEnabled.cjs +0 -8
- package/dist/utils/isPackageDetected.cjs +0 -22
- package/dist/utils/options/defaultOptions.cjs +0 -168
- package/dist/utils/options/enableDetectedConfigs.cjs +0 -36
- package/dist/utils/options/mergeWithDefaults.cjs +0 -22
- package/dist/utils/vue/getRestrictedVueElements.cjs +0 -28
- package/dist/utils/vue/getRestrictedVueInputs.cjs +0 -24
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# @shayanthenerd/eslint-config [](https://www.npmjs.com/package/@shayanthenerd/eslint-config) [](https://github.com/ShayanTheNerd/eslint-config/blob/main/LICENSE) [](https://eslint-config.shayan-zamani.me)
|
|
2
2
|
|
|
3
3
|
A modern, flexible ESLint configuration for enforcing best practices and maintaining a consistent coding style.
|
|
4
4
|
|
|
@@ -8,7 +8,7 @@ A modern, flexible ESLint configuration for enforcing best practices and maintai
|
|
|
8
8
|
- **Automatic Formatting**: Fine-grained control over formatting with [ESLint Stylistic](https://eslint.style), eliminating the need for Prettier
|
|
9
9
|
- **Smart Defaults**: Respects your _.gitignore_ file and provides reasonable, opinionated, yet [highly customizable](#customization) defaults
|
|
10
10
|
- **Developer-friendly**: Easy to use and well-documented with JSDoc
|
|
11
|
-
- **Modern**: Requires Node.js v20.12.0+ and ESLint v9.28.0+
|
|
11
|
+
- **Modern**: Requires Node.js v20.12.0+ and ESLint v9.28.0+ (ESM-only)
|
|
12
12
|
|
|
13
13
|
> [!NOTE]
|
|
14
14
|
> This configuration is designed with a flexible API for easy customization. However, it remains a **personal config**. While its primary goal is to enforce best practices and maintain code consistency, some rules—particularly stylistic ones—are rather opinionated. <br /> If the available customization and override options still don't meet your requirements, feel free to fork the project and tailor it to your needs.
|
|
@@ -34,9 +34,7 @@ A modern, flexible ESLint configuration for enforcing best practices and maintai
|
|
|
34
34
|
npm i -D @shayanthenerd/eslint-config
|
|
35
35
|
```
|
|
36
36
|
|
|
37
|
-
OXLint and all necessary ESLint plugins and parsers will be installed automatically
|
|
38
|
-
|
|
39
|
-
If you're using TypeScript and see [eslint-plugin-import-x](https://github.com/un-ts/eslint-plugin-import-x) fail to resolve imports, you should also install [eslint-import-resolver-typescript](https://github.com/import-js/eslint-import-resolver-typescript) as a dev dependency.
|
|
37
|
+
OXLint and all necessary ESLint plugins and parsers will be installed automatically.
|
|
40
38
|
|
|
41
39
|
2. Create an ESLint config file (_eslint.config.js_) at the root of your project:
|
|
42
40
|
```js
|
|
@@ -45,7 +43,23 @@ import { defineConfig } from '@shayanthenerd/eslint-config';
|
|
|
45
43
|
export default defineConfig();
|
|
46
44
|
```
|
|
47
45
|
|
|
48
|
-
You can also use a TypeScript file (_eslint.config.ts_)
|
|
46
|
+
You can also use a TypeScript file (_eslint.config.ts_). Depending on your Node.js version, [additional setup](https://eslint.org/docs/latest/use/configure/configuration-files#typescript-configuration-files) may be required.
|
|
47
|
+
|
|
48
|
+
If you're using Nuxt, install [@nuxt/eslint](https://eslint.nuxt.com) as a dev dependency:
|
|
49
|
+
```shell
|
|
50
|
+
npm i -D @nuxt/eslint
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Then, update your ESLint config file:
|
|
54
|
+
```js
|
|
55
|
+
import { defineConfig } from '@shayanthenerd/eslint-config';
|
|
56
|
+
|
|
57
|
+
import eslintConfigNuxt from './.nuxt/eslint.config.mjs';
|
|
58
|
+
|
|
59
|
+
const eslintConfig = defineConfig();
|
|
60
|
+
|
|
61
|
+
export default eslintConfigNuxt(eslintConfig);
|
|
62
|
+
```
|
|
49
63
|
|
|
50
64
|
3. Create an OXLint config file (_.oxlintrc.json_) in the root of your project:
|
|
51
65
|
```jsonc
|
|
@@ -123,7 +137,7 @@ npm i -D prettier
|
|
|
123
137
|
|
|
124
138
|
2. Create a Prettier config file (_prettier.config.js_) in the root of your project:
|
|
125
139
|
```js
|
|
126
|
-
import prettierConfig from '@shayanthenerd/eslint-config/prettier
|
|
140
|
+
import prettierConfig from '@shayanthenerd/eslint-config/prettier';
|
|
127
141
|
|
|
128
142
|
/** @type {import('prettier').Config} */
|
|
129
143
|
export default {
|
|
@@ -159,6 +173,7 @@ Install VS Code extensions for [ESLint](https://marketplace.visualstudio.com/ite
|
|
|
159
173
|
/* Imports are sorted and organized with eslint-plugin-perfectionist. */
|
|
160
174
|
"source.sortImports": "never",
|
|
161
175
|
"source.organizeImports": "never",
|
|
176
|
+
"source.removeUnusedImports": "never",
|
|
162
177
|
|
|
163
178
|
/* Apply OXLint and ESLint automatic fixes on file save. */
|
|
164
179
|
"source.fixAll.oxc": "explicit",
|
|
@@ -232,7 +247,7 @@ Since OXLint and ESLint use separate config files, customizations made in your E
|
|
|
232
247
|
],
|
|
233
248
|
|
|
234
249
|
/* OXLint respects the ignore patterns defined in `.gitignore` and `.eslintignore` files by default. */
|
|
235
|
-
"ignorePatterns": ["**/*.min.*"
|
|
250
|
+
"ignorePatterns": ["**/*.min.*"]
|
|
236
251
|
}
|
|
237
252
|
```
|
|
238
253
|
|
|
@@ -384,7 +399,8 @@ interface options {
|
|
|
384
399
|
overrides?: {},
|
|
385
400
|
},
|
|
386
401
|
importX?: boolean | {
|
|
387
|
-
|
|
402
|
+
removeUnusedImports?: boolean,
|
|
403
|
+
requireFileExtension?: boolean,
|
|
388
404
|
overrides?: {},
|
|
389
405
|
},
|
|
390
406
|
perfectionist?: boolean | {
|
package/dist/configs/base.js
CHANGED
|
@@ -13,8 +13,8 @@ function getBaseConfig(options) {
|
|
|
13
13
|
files: [globs.src, vue ? globs.vue : ""],
|
|
14
14
|
extends: [javascriptESLint.configs.recommended],
|
|
15
15
|
languageOptions: {
|
|
16
|
+
parser: typescriptESLint.parser,
|
|
16
17
|
parserOptions: {
|
|
17
|
-
parser: typescriptESLint.parser,
|
|
18
18
|
ecmaVersion: "latest",
|
|
19
19
|
ecmaFeatures: {
|
|
20
20
|
jsx: true,
|
package/dist/configs/commons.js
CHANGED
|
@@ -3,14 +3,15 @@ import typescriptESLint from "typescript-eslint";
|
|
|
3
3
|
|
|
4
4
|
//#region src/configs/commons.ts
|
|
5
5
|
function getCommonsConfig(options) {
|
|
6
|
+
const { typescript, base: { preferNamedExports } } = options.configs;
|
|
6
7
|
const commonsConfig = {
|
|
7
8
|
name: "shayanthenerd/commons",
|
|
8
9
|
files: [globs.commons],
|
|
9
10
|
ignores: [globs.commonsIgnore],
|
|
10
11
|
plugins: { "@typescript-eslint": typescriptESLint.plugin },
|
|
11
12
|
rules: {
|
|
12
|
-
"@typescript-eslint/explicit-function-return-type": "error",
|
|
13
|
-
"no-restricted-exports": [
|
|
13
|
+
"@typescript-eslint/explicit-function-return-type": typescript ? "error" : "off",
|
|
14
|
+
"no-restricted-exports": [preferNamedExports ? "error" : "off", { restrictDefaultExports: {
|
|
14
15
|
named: true,
|
|
15
16
|
direct: true,
|
|
16
17
|
namedFrom: true,
|
package/dist/configs/importX.js
CHANGED
|
@@ -3,19 +3,39 @@ import { isEnabled } from "../utils/isEnabled.js";
|
|
|
3
3
|
import { defaultOptions } from "../utils/options/defaultOptions.js";
|
|
4
4
|
import { getImportXRules } from "../rules/importX.js";
|
|
5
5
|
import { mergeConfigs } from "eslint-flat-config-utils";
|
|
6
|
+
import eslintPluginImport from "eslint-plugin-import";
|
|
6
7
|
import eslintPluginImportX from "eslint-plugin-import-x";
|
|
7
8
|
import eslintPluginUnusedImports from "eslint-plugin-unused-imports";
|
|
8
9
|
|
|
9
10
|
//#region src/configs/importX.ts
|
|
11
|
+
eslintPluginImport.flatConfigs.recommended.rules = {};
|
|
10
12
|
function getImportXConfig(options) {
|
|
11
13
|
const { vue, importX, typescript } = options.configs;
|
|
12
14
|
const { overrides } = isEnabled(importX) ? importX : defaultOptions.configs.importX;
|
|
13
15
|
const importXConfig = {
|
|
14
16
|
name: "shayanthenerd/import-x",
|
|
15
17
|
files: [globs.src, vue ? globs.vue : ""],
|
|
16
|
-
extends: [
|
|
18
|
+
extends: [
|
|
19
|
+
eslintPluginImport.flatConfigs.recommended,
|
|
20
|
+
eslintPluginImportX.flatConfigs.recommended,
|
|
21
|
+
typescript ? eslintPluginImport.flatConfigs.typescript : {},
|
|
22
|
+
typescript ? eslintPluginImportX.flatConfigs.typescript : {}
|
|
23
|
+
],
|
|
17
24
|
plugins: { "unused-imports": eslintPluginUnusedImports },
|
|
18
|
-
settings: {
|
|
25
|
+
settings: {
|
|
26
|
+
"import/resolver": { typescript: true },
|
|
27
|
+
"import/extensions": [
|
|
28
|
+
".js",
|
|
29
|
+
".cjs",
|
|
30
|
+
".mjs",
|
|
31
|
+
".jsx",
|
|
32
|
+
".ts",
|
|
33
|
+
".cts",
|
|
34
|
+
".mts",
|
|
35
|
+
".tsx",
|
|
36
|
+
".vue"
|
|
37
|
+
]
|
|
38
|
+
},
|
|
19
39
|
rules: getImportXRules(options)
|
|
20
40
|
};
|
|
21
41
|
return mergeConfigs(importXConfig, overrides);
|
|
@@ -5,6 +5,7 @@ import { getVitestRules } from "../rules/vitest.js";
|
|
|
5
5
|
import { getImportXRules } from "../rules/importX.js";
|
|
6
6
|
import { getPlaywrightRules } from "../rules/playwright.js";
|
|
7
7
|
import { getTypeScriptRules } from "../rules/typescript.js";
|
|
8
|
+
import typescriptESLint from "typescript-eslint";
|
|
8
9
|
import eslintPluginVitest from "@vitest/eslint-plugin";
|
|
9
10
|
import eslintPluginImportX from "eslint-plugin-import-x";
|
|
10
11
|
import eslintPluginPlaywright from "eslint-plugin-playwright";
|
|
@@ -28,7 +29,8 @@ function getOXLintOverridesConfig(options) {
|
|
|
28
29
|
plugins: {
|
|
29
30
|
"vitest": eslintPluginVitest,
|
|
30
31
|
"import-x": eslintPluginImportX,
|
|
31
|
-
"playwright": eslintPluginPlaywright
|
|
32
|
+
"playwright": eslintPluginPlaywright,
|
|
33
|
+
"@typescript-eslint": typescriptESLint.plugin
|
|
32
34
|
},
|
|
33
35
|
rules: {
|
|
34
36
|
"max-depth": javascriptRules["max-depth"],
|
package/dist/configs/tailwind.js
CHANGED
|
@@ -13,7 +13,7 @@ const eslintParserHTML = eslintPluginHTML.configs["flat/recommended"].languageOp
|
|
|
13
13
|
const eslintParserVue = eslintPluginVue.configs["flat/recommended"].find((config) => config.name === "vue/base/setup-for-vue")?.languageOptions?.parser;
|
|
14
14
|
function getTailwindConfig(options) {
|
|
15
15
|
const { tsConfig, configs: { vue, html, tailwind } } = options;
|
|
16
|
-
const {
|
|
16
|
+
const { config, entryPoint, overrides } = isEnabled(tailwind) ? tailwind : defaultOptions.configs.tailwind;
|
|
17
17
|
const tailwindConfig = {
|
|
18
18
|
name: "shayanthenerd/tailwind",
|
|
19
19
|
files: [
|
|
@@ -24,8 +24,8 @@ function getTailwindConfig(options) {
|
|
|
24
24
|
plugins: { "better-tailwindcss": eslintPluginTailwind },
|
|
25
25
|
languageOptions: { parserOptions: { parser: html ? eslintParserHTML : eslintParserVue } },
|
|
26
26
|
settings: { "better-tailwindcss": {
|
|
27
|
-
entryPoint
|
|
28
|
-
tailwindConfig:
|
|
27
|
+
entryPoint,
|
|
28
|
+
tailwindConfig: config,
|
|
29
29
|
tsconfig: tsConfig ? path.resolve(tsConfig.rootDir, tsConfig.filename) : void 0,
|
|
30
30
|
attributes: [["^v-bind:ui$", [{ match: "objectValues" }]], ["^(?:v-bind:)?(class|activeClass|inactiveClass)$", [
|
|
31
31
|
{ match: "strings" },
|
|
@@ -12,7 +12,7 @@ function getTypeScriptConfig(options) {
|
|
|
12
12
|
const { overrides } = isEnabled(typescript) ? typescript : defaultOptions.configs.typescript;
|
|
13
13
|
const typescriptConfig = {
|
|
14
14
|
name: "shayanthenerd/typescript",
|
|
15
|
-
files: [globs.
|
|
15
|
+
files: [globs.ts, vue ? globs.vue : ""],
|
|
16
16
|
extends: [typescriptESLint.configs.strictTypeChecked, typescriptESLint.configs.stylisticTypeChecked],
|
|
17
17
|
languageOptions: { parserOptions: {
|
|
18
18
|
tsconfigRootDir: tsConfig ? tsConfig.rootDir : void 0,
|
package/dist/prettier.config.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
//#region src/prettier.config.ts
|
|
2
|
+
const prettierConfig = {
|
|
3
3
|
semi: true,
|
|
4
4
|
useTabs: true,
|
|
5
5
|
tabWidth: 2,
|
|
@@ -7,36 +7,32 @@ export default {
|
|
|
7
7
|
printWidth: 120,
|
|
8
8
|
singleQuote: true,
|
|
9
9
|
jsxSingleQuote: false,
|
|
10
|
-
quoteProps:
|
|
10
|
+
quoteProps: "consistent",
|
|
11
11
|
insertPragma: false,
|
|
12
12
|
requirePragma: false,
|
|
13
13
|
bracketSpacing: true,
|
|
14
14
|
bracketSameLine: false,
|
|
15
|
-
endOfLine:
|
|
16
|
-
trailingComma:
|
|
17
|
-
arrowParens:
|
|
18
|
-
proseWrap:
|
|
19
|
-
objectWrap:
|
|
15
|
+
endOfLine: "lf",
|
|
16
|
+
trailingComma: "all",
|
|
17
|
+
arrowParens: "always",
|
|
18
|
+
proseWrap: "preserve",
|
|
19
|
+
objectWrap: "preserve",
|
|
20
20
|
singleAttributePerLine: false,
|
|
21
|
-
htmlWhitespaceSensitivity:
|
|
22
|
-
embeddedLanguageFormatting:
|
|
21
|
+
htmlWhitespaceSensitivity: "css",
|
|
22
|
+
embeddedLanguageFormatting: "auto",
|
|
23
23
|
rangeStart: 0,
|
|
24
24
|
rangeEnd: Number.POSITIVE_INFINITY,
|
|
25
25
|
experimentalTernaries: false,
|
|
26
|
-
experimentalOperatorPosition:
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
{
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
files: '*.svg',
|
|
37
|
-
options: {
|
|
38
|
-
parser: 'html',
|
|
39
|
-
},
|
|
40
|
-
},
|
|
41
|
-
],
|
|
26
|
+
experimentalOperatorPosition: "end",
|
|
27
|
+
overrides: [{
|
|
28
|
+
files: ["*.jsonc", "bun.lock"],
|
|
29
|
+
options: { parser: "json" }
|
|
30
|
+
}, {
|
|
31
|
+
files: "*.svg",
|
|
32
|
+
options: { parser: "html" }
|
|
33
|
+
}]
|
|
42
34
|
};
|
|
35
|
+
var prettier_config_default = prettierConfig;
|
|
36
|
+
|
|
37
|
+
//#endregion
|
|
38
|
+
export { prettier_config_default as default };
|
package/dist/rules/importX.js
CHANGED
|
@@ -5,9 +5,18 @@ import path from "node:path";
|
|
|
5
5
|
//#region src/rules/importX.ts
|
|
6
6
|
function getImportXRules(options) {
|
|
7
7
|
const { packageDir, configs: { importX } } = options;
|
|
8
|
-
const { requireFileExtension } = isEnabled(importX) ? importX : defaultOptions.configs.importX;
|
|
8
|
+
const { removeUnusedImports, requireFileExtension } = isEnabled(importX) ? importX : defaultOptions.configs.importX;
|
|
9
9
|
const importXRules = {
|
|
10
|
-
"unused-imports/no-unused-imports": "warn",
|
|
10
|
+
"unused-imports/no-unused-imports": removeUnusedImports ? "warn" : "off",
|
|
11
|
+
"import-x/extensions": "off",
|
|
12
|
+
"import/extensions": [
|
|
13
|
+
requireFileExtension ? "warn" : "off",
|
|
14
|
+
"always",
|
|
15
|
+
{
|
|
16
|
+
ignorePackages: true,
|
|
17
|
+
checkTypeImports: true
|
|
18
|
+
}
|
|
19
|
+
],
|
|
11
20
|
"import-x/no-amd": "error",
|
|
12
21
|
"import-x/exports-last": "warn",
|
|
13
22
|
"import-x/no-commonjs": "error",
|
|
@@ -32,16 +41,7 @@ function getImportXRules(options) {
|
|
|
32
41
|
"import-x/no-extraneous-dependencies": ["error", {
|
|
33
42
|
includeTypes: true,
|
|
34
43
|
packageDir: path.resolve(packageDir)
|
|
35
|
-
}]
|
|
36
|
-
"import-x/extensions": [
|
|
37
|
-
"error",
|
|
38
|
-
requireFileExtension,
|
|
39
|
-
{
|
|
40
|
-
fix: true,
|
|
41
|
-
ignorePackages: true,
|
|
42
|
-
checkTypeImports: true
|
|
43
|
-
}
|
|
44
|
-
]
|
|
44
|
+
}]
|
|
45
45
|
};
|
|
46
46
|
return importXRules;
|
|
47
47
|
}
|
package/dist/rules/vue.js
CHANGED
|
@@ -12,9 +12,11 @@ function getVueRules(options) {
|
|
|
12
12
|
const nuxtUI = isEnabled(nuxt) ? nuxt.ui : void 0;
|
|
13
13
|
const nuxtUIPrefix = isEnabled(nuxt) && isEnabled(nuxt.ui) ? nuxt.ui.prefix : void 0;
|
|
14
14
|
const isScriptLangTS = blockLang.script === "ts";
|
|
15
|
+
const isStyleLangImplicit = blockLang.style === "implicit";
|
|
15
16
|
const vueRules = {
|
|
16
17
|
"no-undef": "off",
|
|
17
18
|
"no-useless-assignment": "off",
|
|
19
|
+
"import-x/default": "off",
|
|
18
20
|
"vue/comment-directive": ["error", { reportUnusedDisableDirectives: true }],
|
|
19
21
|
"vue/html-closing-bracket-newline": "warn",
|
|
20
22
|
"vue/singleline-html-element-content-newline": "off",
|
|
@@ -100,8 +102,8 @@ function getVueRules(options) {
|
|
|
100
102
|
"vue/block-lang": ["error", {
|
|
101
103
|
script: { lang: blockLang.script },
|
|
102
104
|
style: {
|
|
103
|
-
lang: blockLang.style,
|
|
104
|
-
allowNoLang:
|
|
105
|
+
lang: isStyleLangImplicit ? void 0 : blockLang.style,
|
|
106
|
+
allowNoLang: isStyleLangImplicit
|
|
105
107
|
}
|
|
106
108
|
}],
|
|
107
109
|
"vue/block-tag-newline": ["warn", {
|
|
@@ -1,20 +1,29 @@
|
|
|
1
|
-
import { RuleOptions } from "../eslintRules.js";
|
|
2
1
|
import { ConfigWithOverrides } from "../index.js";
|
|
3
2
|
|
|
4
3
|
//#region src/types/configOptions/importX.d.ts
|
|
5
|
-
|
|
6
|
-
type RequireFileExtension = Exclude<RequireFileExtensionOptions, 'ignorePackages' | Record<string, unknown>>;
|
|
4
|
+
|
|
7
5
|
interface ImportXOptions extends ConfigWithOverrides {
|
|
8
6
|
/**
|
|
9
|
-
*
|
|
7
|
+
* Automatically remove unused imports.
|
|
8
|
+
*
|
|
9
|
+
* @default true
|
|
10
|
+
*
|
|
11
|
+
* @see [unused-imports/no-unused-imports](https://github.com/sweepline/eslint-plugin-unused-imports/blob/master/docs/rules/no-unused-imports.md)
|
|
12
|
+
*/
|
|
13
|
+
removeUnusedImports?: boolean;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Require file extensions within the import path.
|
|
10
17
|
*
|
|
11
18
|
* Imports from third-party packages are ignored.
|
|
12
19
|
*
|
|
13
|
-
*
|
|
20
|
+
* `import-x/extensions` rule is currently broken, so `import/extensions` is used as a temporary replacement.
|
|
21
|
+
*
|
|
22
|
+
* @default true
|
|
14
23
|
*
|
|
15
|
-
* @see [import
|
|
24
|
+
* @see [import/extensions](https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/extensions.md)
|
|
16
25
|
*/
|
|
17
|
-
requireFileExtension?:
|
|
26
|
+
requireFileExtension?: boolean;
|
|
18
27
|
}
|
|
19
28
|
//#endregion
|
|
20
29
|
export { type ImportXOptions };
|