@shayanthenerd/eslint-config 0.14.0 → 0.15.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 +1 -1
- package/README.md +187 -178
- package/dist/configs/base.mjs +13 -9
- package/dist/configs/css.mjs +2 -2
- package/dist/configs/cypress.mjs +2 -2
- package/dist/configs/html.mjs +2 -2
- package/dist/configs/importX.mjs +2 -2
- package/dist/configs/oxlintOverrides.mjs +16 -11
- package/dist/configs/perfectionist.mjs +2 -2
- package/dist/configs/playwright.mjs +2 -2
- package/dist/configs/restrictedExports.mjs +1 -1
- package/dist/configs/storybook.mjs +2 -2
- package/dist/configs/stylistic.mjs +2 -2
- package/dist/configs/tailwind.mjs +4 -4
- package/dist/configs/typescript.mjs +2 -2
- package/dist/configs/vitest.mjs +2 -2
- package/dist/configs/vue.mjs +2 -2
- package/dist/configs/vueComponentNames.mjs +1 -1
- package/dist/configs/vueServerComponents.mjs +1 -1
- package/dist/configs/zod.mjs +2 -2
- package/dist/{utils → helpers}/globs.mjs +1 -1
- package/dist/{utils → helpers}/ignores/defaultIgnorePatterns.mjs +1 -1
- package/dist/{utils → helpers}/ignores/getIgnorePatterns.mjs +1 -1
- package/dist/{utils → helpers}/ignores/resolveGitignorePatterns.mjs +1 -1
- package/dist/{utils → helpers}/isPackageDetected.mjs +1 -1
- package/dist/{utils → helpers}/options/defaultOptions.mjs +13 -7
- package/dist/{utils → helpers}/options/enableDetectedConfigs.mjs +1 -3
- package/dist/{utils → helpers}/options/mergeWithDefaults.mjs +4 -5
- package/dist/{utils → helpers}/vue/getRestrictedVueElements.mjs +1 -1
- package/dist/{utils → helpers}/vue/getRestrictedVueInputs.mjs +1 -1
- package/dist/index.mjs +3 -3
- package/dist/oxlint.config.jsonc +209 -206
- package/dist/prettier.config.mjs +1 -1
- package/dist/rules/css.mjs +1 -1
- package/dist/rules/html.mjs +3 -3
- package/dist/rules/importX.mjs +1 -1
- package/dist/rules/javascript.mjs +1 -2
- package/dist/rules/perfectionist.mjs +2 -2
- package/dist/rules/stylistic.mjs +10 -7
- package/dist/rules/tailwind.mjs +4 -4
- package/dist/rules/typescript.mjs +2 -2
- package/dist/rules/vue.mjs +6 -6
- package/dist/rules/vueAccessibility.mjs +1 -1
- package/dist/types/configOptions/base.d.mts +8 -8
- package/dist/types/configOptions/nuxt.d.mts +3 -3
- package/dist/types/configOptions/stylistic.d.mts +0 -15
- package/dist/types/configOptions/test.d.mts +4 -4
- package/dist/types/configOptions/vue.d.mts +1 -1
- package/dist/types/eslint-schema.d.mts +549 -201
- package/dist/types/index.d.mts +36 -19
- package/package.json +139 -124
package/dist/rules/vue.mjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { isEnabled } from "../utils/isEnabled.mjs";
|
|
2
|
-
import { defaultOptions } from "../
|
|
3
|
-
import { getRestrictedVueInputs } from "../
|
|
4
|
-
import { getRestrictedVueElements } from "../
|
|
2
|
+
import { defaultOptions } from "../helpers/options/defaultOptions.mjs";
|
|
3
|
+
import { getRestrictedVueInputs } from "../helpers/vue/getRestrictedVueInputs.mjs";
|
|
4
|
+
import { getRestrictedVueElements } from "../helpers/vue/getRestrictedVueElements.mjs";
|
|
5
5
|
|
|
6
6
|
//#region src/rules/vue.ts
|
|
7
7
|
function getVueRules(options) {
|
|
8
8
|
const { typescript, stylistic, tailwind, vue, nuxt } = options.configs;
|
|
9
|
-
const { indent,
|
|
9
|
+
const { indent, trailingComma, maxLineLength, maxAttributesPerLine, maxConsecutiveEmptyLines, selfCloseVoidHTMLElements } = isEnabled(stylistic) ? stylistic : defaultOptions.configs.stylistic;
|
|
10
10
|
const { blockLang, blocksOrder, macrosOrder, attributesOrder, destructureProps, vForDelimiterStyle, attributeHyphenation, allowedStyleAttributes, preferVBindTrueShorthand, componentNameCaseInTemplate, preferVBindSameNameShorthand, restrictedElements: userRestrictedElements, ignoredUndefinedComponents: userIgnoredUndefinedComponents, restrictedStaticAttributes: userRestrictedStaticAttributes } = isEnabled(vue) ? vue : defaultOptions.configs.vue;
|
|
11
11
|
const isNuxtEnabled = isEnabled(nuxt);
|
|
12
12
|
const isNuxtImageEnabled = isNuxtEnabled ? nuxt.image : void 0;
|
|
@@ -115,7 +115,7 @@ function getVueRules(options) {
|
|
|
115
115
|
"vue/html-closing-bracket-newline": "warn",
|
|
116
116
|
"vue/html-closing-bracket-spacing": "warn",
|
|
117
117
|
"vue/html-end-tags": "warn",
|
|
118
|
-
"vue/html-indent": ["warn",
|
|
118
|
+
"vue/html-indent": ["warn", indent],
|
|
119
119
|
"vue/html-quotes": "warn",
|
|
120
120
|
"vue/html-self-closing": ["error", { html: {
|
|
121
121
|
normal: "never",
|
|
@@ -259,7 +259,7 @@ function getVueRules(options) {
|
|
|
259
259
|
"vue/html-button-has-type": "error",
|
|
260
260
|
"vue/html-comment-content-newline": "warn",
|
|
261
261
|
"vue/html-comment-content-spacing": "warn",
|
|
262
|
-
"vue/html-comment-indent": ["warn",
|
|
262
|
+
"vue/html-comment-indent": ["warn", indent],
|
|
263
263
|
"vue/match-component-file-name": ["error", {
|
|
264
264
|
shouldMatchCase: true,
|
|
265
265
|
extensions: isEnabled(typescript) ? [
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { isEnabled } from "../utils/isEnabled.mjs";
|
|
2
|
-
import { defaultOptions } from "../
|
|
2
|
+
import { defaultOptions } from "../helpers/options/defaultOptions.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/rules/vueAccessibility.ts
|
|
5
5
|
function getVueAccessibilityRules(options) {
|
|
@@ -18,14 +18,14 @@ interface BaseOptions extends ConfigWithOverrides {
|
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
20
|
* Enforce named exports in the following directories:
|
|
21
|
-
* -
|
|
22
|
-
* -
|
|
23
|
-
* -
|
|
24
|
-
* -
|
|
25
|
-
* -
|
|
26
|
-
* -
|
|
27
|
-
* -
|
|
28
|
-
* -
|
|
21
|
+
* - shared
|
|
22
|
+
* - dto, dtos
|
|
23
|
+
* - model, models
|
|
24
|
+
* - helper, helpers
|
|
25
|
+
* - module, modules
|
|
26
|
+
* - util, utils, utilities
|
|
27
|
+
* - composable, composables
|
|
28
|
+
* - repo, repos, repository, repositories
|
|
29
29
|
*
|
|
30
30
|
* @default true
|
|
31
31
|
*
|
|
@@ -5,7 +5,7 @@ interface NuxtOptions {
|
|
|
5
5
|
*
|
|
6
6
|
* Enforce the use of `<NuxtImg>` instead of `<img>`.
|
|
7
7
|
*
|
|
8
|
-
* @default false // `true` if "@nuxt/image" is detected in the
|
|
8
|
+
* @default false // `true` if "@nuxt/image" is detected in the dependencies when `autoDetectDeps` is enabled
|
|
9
9
|
*
|
|
10
10
|
* @see [vue/no-restricted-html-elements](https://eslint.vuejs.org/rules/no-restricted-html-elements)
|
|
11
11
|
*/
|
|
@@ -16,7 +16,7 @@ interface NuxtOptions {
|
|
|
16
16
|
*
|
|
17
17
|
* Allows ESLint to recognize the icon component.
|
|
18
18
|
*
|
|
19
|
-
* @default false // `true` if "@nuxt/icon" is detected in the
|
|
19
|
+
* @default false // `true` if "@nuxt/icon" is detected in the dependencies when `autoDetectDeps` is enabled
|
|
20
20
|
*
|
|
21
21
|
* @see [vue/no-undef-components](https://eslint.vuejs.org/rules/no-undef-components)
|
|
22
22
|
*/
|
|
@@ -42,7 +42,7 @@ interface NuxtOptions {
|
|
|
42
42
|
*
|
|
43
43
|
* Enforce the use of NuxtUI components over their standard counterparts. For example, `<ULink>` must be used instead of `<a>`, `<UInput>` instead of `<input>`, etc.
|
|
44
44
|
*
|
|
45
|
-
* @default false // `true` if "@nuxt/ui" is detected in the
|
|
45
|
+
* @default false // `true` if "@nuxt/ui" is detected in the dependencies when `autoDetectDeps` is enabled
|
|
46
46
|
*
|
|
47
47
|
* @see [vue/no-restricted-html-elements](https://eslint.vuejs.org/rules/no-restricted-html-elements)
|
|
48
48
|
*/
|
|
@@ -61,21 +61,6 @@ interface StylisticOptions extends ConfigWithOverrides {
|
|
|
61
61
|
*/
|
|
62
62
|
arrowParens?: RuleOptions<'@stylistic/arrow-parens'>;
|
|
63
63
|
|
|
64
|
-
/**
|
|
65
|
-
* Use tabs for indentation.
|
|
66
|
-
*
|
|
67
|
-
* This is used by
|
|
68
|
-
* - [vue/html-indent](https://eslint.vuejs.org/rules/html-indent)
|
|
69
|
-
* - [@html-eslint/indent](https://html-eslint.org/docs/rules/indent)
|
|
70
|
-
* - [@stylistic/indent](https://eslint.style/rules/indent)
|
|
71
|
-
* - [@stylistic/no-tabs](https://eslint.style/rules/no-tabs)
|
|
72
|
-
* - [@stylistic/indent-binary-ops](https://eslint.style/rules/indent-binary-ops)
|
|
73
|
-
* - [better-tailwindcss/enforce-consistent-line-wrapping](https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/rules/enforce-consistent-line-wrapping.md)
|
|
74
|
-
*
|
|
75
|
-
* @default true
|
|
76
|
-
*/
|
|
77
|
-
useTabs?: boolean;
|
|
78
|
-
|
|
79
64
|
/**
|
|
80
65
|
* The number of space characters used for indentation.
|
|
81
66
|
*
|
|
@@ -6,28 +6,28 @@ interface TestOptions {
|
|
|
6
6
|
/**
|
|
7
7
|
* Use [eslint-plugin-storybook](https://github.com/storybookjs/eslint-plugin-storybook) to enforce best practices and code styles for Storybook stories and tests.
|
|
8
8
|
*
|
|
9
|
-
* @default false // `true` if "storybook" is detected in the
|
|
9
|
+
* @default false // `true` if "storybook" is detected in the dependencies when `autoDetectDeps` is enabled
|
|
10
10
|
*/
|
|
11
11
|
storybook?: boolean | ConfigWithOverrides;
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* Use [eslint-plugin-vitest](https://github.com/vitest-dev/eslint-plugin-vitest) to enforce best practices and code styles for Vitest tests.
|
|
15
15
|
*
|
|
16
|
-
* @default false // `true` if "vitest" is detected in the
|
|
16
|
+
* @default false // `true` if "vitest" is detected in the dependencies when `autoDetectDeps` is enabled
|
|
17
17
|
*/
|
|
18
18
|
vitest?: boolean | ConfigWithOverrides;
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
21
|
* Use [eslint-plugin-playwright](https://github.com/playwright-community/eslint-plugin-playwright) to enforce best practices and code styles for Playwright tests.
|
|
22
22
|
*
|
|
23
|
-
* @default false // `true` if "@playwright/test" is detected in the
|
|
23
|
+
* @default false // `true` if "@playwright/test" is detected in the dependencies when `autoDetectDeps` is enabled
|
|
24
24
|
*/
|
|
25
25
|
playwright?: boolean | ConfigWithOverrides;
|
|
26
26
|
|
|
27
27
|
/**
|
|
28
28
|
* Use [eslint-plugin-cypress](https://github.com/cypress-io/eslint-plugin-cypress) to enforce best practices and code styles for Cypress tests.
|
|
29
29
|
*
|
|
30
|
-
* @default false // `true` if "cypress" is detected in the
|
|
30
|
+
* @default false // `true` if "cypress" is detected in the dependencies when `autoDetectDeps` is enabled
|
|
31
31
|
*/
|
|
32
32
|
cypress?: boolean | ConfigWithOverrides;
|
|
33
33
|
|
|
@@ -124,7 +124,7 @@ interface VueOptions extends ConfigWithOverrides {
|
|
|
124
124
|
*
|
|
125
125
|
* @default
|
|
126
126
|
* {
|
|
127
|
-
* script: 'js', // `'ts'` if "typescript" is detected in the
|
|
127
|
+
* script: 'js', // `'ts'` if "typescript" is detected in the dependencies when `autoDetectDeps` is enabled
|
|
128
128
|
* style: 'implicit',
|
|
129
129
|
* }
|
|
130
130
|
*
|