@shayanthenerd/eslint-config 0.26.0 → 0.26.2
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 +13 -6
- package/dist/configs/html.mjs +1 -1
- package/dist/configs/react.mjs +2 -4
- package/dist/configs/vue.mjs +1 -5
- package/dist/helpers/ignores/defaultIgnorePatterns.mjs +1 -0
- package/dist/helpers/isPackageDetected.mjs +5 -4
- package/dist/helpers/options/enableDetectedConfigs.mjs +33 -16
- package/dist/rules/html.mjs +1 -0
- package/dist/rules/javascript.mjs +1 -1
- package/dist/rules/node.mjs +1 -1
- package/dist/rules/packageJson.mjs +28 -0
- package/dist/rules/react.mjs +49 -44
- package/dist/rules/unicorn.mjs +13 -0
- package/dist/rules/vue.mjs +45 -3
- package/dist/types/eslint-schema.d.mts +385 -312
- package/dist/types/options/vue.d.mts +33 -2
- package/package.json +21 -21
- package/dist/rules/vueAccessibility.mjs +0 -47
- package/dist/types/options/vueAccessibility.d.mts +0 -38
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { PluginRules, RuleOptions } from "../eslintRules.mjs";
|
|
2
|
-
import { VueAccessibilityOptions } from "./vueAccessibility.mjs";
|
|
3
2
|
import { ConfigWithOverrides } from "../index.mjs";
|
|
4
3
|
|
|
5
4
|
//#region src/types/options/vue.d.ts
|
|
5
|
+
type AnchorHasContentRuleOptions = RuleOptions<'vuejs-accessibility/anchor-has-content'>;
|
|
6
6
|
interface BlockLang {
|
|
7
7
|
style?: 'css' | 'scss' | 'postcss' | 'implicit';
|
|
8
8
|
script?: 'js' | 'ts' | 'jsx' | 'tsx' | 'implicit';
|
|
@@ -17,7 +17,38 @@ interface VueOptions extends ConfigWithOverrides<ConfigRules> {
|
|
|
17
17
|
*
|
|
18
18
|
* @default true
|
|
19
19
|
*/
|
|
20
|
-
accessibility?: boolean |
|
|
20
|
+
accessibility?: boolean | {
|
|
21
|
+
/**
|
|
22
|
+
* Names of components that should be considered accessible child elements.
|
|
23
|
+
*
|
|
24
|
+
* New items extend the defaults instead of overriding them.
|
|
25
|
+
*
|
|
26
|
+
* @default ['img', 'picture', 'NuxtImg', 'NuxtPicture', 'UBadge']
|
|
27
|
+
*
|
|
28
|
+
* @see [vuejs-accessibility/anchor-has-content: `accessibleChildren` option](https://vue-a11y.github.io/eslint-plugin-vuejs-accessibility/rules/anchor-has-content#%F0%9F%94%A7-options)
|
|
29
|
+
*/
|
|
30
|
+
accessibleChildComponents?: AnchorHasContentRuleOptions['accessibleChildren'];
|
|
31
|
+
/**
|
|
32
|
+
* Names of components that render an `<a>` element.
|
|
33
|
+
*
|
|
34
|
+
* New items extend the defaults instead of overriding them.
|
|
35
|
+
*
|
|
36
|
+
* @default ['RouterLink', 'NuxtLink', 'ULink']
|
|
37
|
+
*
|
|
38
|
+
* @see [vuejs-accessibility/anchor-has-content: `components` option](https://vue-a11y.github.io/eslint-plugin-vuejs-accessibility/rules/anchor-has-content#%F0%9F%94%A7-options)
|
|
39
|
+
*/
|
|
40
|
+
anchorComponents?: AnchorHasContentRuleOptions['components'];
|
|
41
|
+
/**
|
|
42
|
+
* Names of components that render an `<img>` element.
|
|
43
|
+
*
|
|
44
|
+
* New items extend the defaults instead of overriding them.
|
|
45
|
+
*
|
|
46
|
+
* @default ['NuxtImg']
|
|
47
|
+
*
|
|
48
|
+
* @see [vuejs-accessibility/alt-text: `img` option](https://vue-a11y.github.io/eslint-plugin-vuejs-accessibility/rules/alt-text#%F0%9F%94%A7-options)
|
|
49
|
+
*/
|
|
50
|
+
imageComponents?: RuleOptions<'vuejs-accessibility/alt-text'>['img'];
|
|
51
|
+
};
|
|
21
52
|
/**
|
|
22
53
|
* Enforce the use of specific attributes such as `scoped` and `module` on top-level `<style>` blocks.
|
|
23
54
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shayanthenerd/eslint-config",
|
|
3
|
-
"version": "0.26.
|
|
3
|
+
"version": "0.26.2",
|
|
4
4
|
"description": "A modern, flexible ESLint configuration for enforcing best practices and maintaining a consistent coding style",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -46,37 +46,37 @@
|
|
|
46
46
|
"pre-commit": "./node_modules/.bin/nano-staged"
|
|
47
47
|
},
|
|
48
48
|
"nano-staged": {
|
|
49
|
-
"**/*.{json,
|
|
49
|
+
"**/*.{json,yaml}!pnpm-lock.yaml": "pnpm format",
|
|
50
50
|
"pnpm-lock.yaml": "pnpm generate:types && pnpm generate:docs",
|
|
51
51
|
"src/types/**/*.d.ts": "pnpm generate:docs",
|
|
52
52
|
"{**/*.ts,package.json}": "pnpm lint"
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"@eslint-react/eslint-plugin": "5.9.
|
|
55
|
+
"@eslint-react/eslint-plugin": "5.9.5",
|
|
56
56
|
"@eslint/css": "1.3.0",
|
|
57
57
|
"@eslint/markdown": "8.0.2",
|
|
58
|
-
"@html-eslint/eslint-plugin": "0.
|
|
59
|
-
"@html-eslint/eslint-plugin-react": "0.
|
|
58
|
+
"@html-eslint/eslint-plugin": "0.63.0",
|
|
59
|
+
"@html-eslint/eslint-plugin-react": "0.63.0",
|
|
60
60
|
"@next/eslint-plugin-next": "16.2.9",
|
|
61
61
|
"@stylistic/eslint-plugin": "5.10.0",
|
|
62
62
|
"@vitest/eslint-plugin": "1.6.20",
|
|
63
|
-
"astro-eslint-parser": "2.
|
|
63
|
+
"astro-eslint-parser": "2.1.0",
|
|
64
64
|
"defu": "6.1.7",
|
|
65
65
|
"eslint-flat-config-utils": "3.2.0",
|
|
66
66
|
"eslint-import-resolver-typescript": "4.4.5",
|
|
67
|
-
"eslint-plugin-astro": "2.1.
|
|
67
|
+
"eslint-plugin-astro": "2.1.1",
|
|
68
68
|
"eslint-plugin-baseline-js": "0.6.2",
|
|
69
69
|
"eslint-plugin-better-tailwindcss": "4.6.0",
|
|
70
70
|
"eslint-plugin-cypress": "6.4.1",
|
|
71
71
|
"eslint-plugin-import-x": "4.17.0",
|
|
72
72
|
"eslint-plugin-jsx-a11y": "6.10.2",
|
|
73
|
-
"eslint-plugin-n": "18.1
|
|
73
|
+
"eslint-plugin-n": "18.2.1",
|
|
74
74
|
"eslint-plugin-package-json": "1.5.0",
|
|
75
75
|
"eslint-plugin-perfectionist": "5.9.1",
|
|
76
76
|
"eslint-plugin-playwright": "2.10.4",
|
|
77
77
|
"eslint-plugin-promise": "7.3.0",
|
|
78
78
|
"eslint-plugin-storybook": "10.4.6",
|
|
79
|
-
"eslint-plugin-unicorn": "
|
|
79
|
+
"eslint-plugin-unicorn": "69.0.0",
|
|
80
80
|
"eslint-plugin-vue": "10.9.2",
|
|
81
81
|
"eslint-plugin-vuejs-accessibility": "2.5.0",
|
|
82
82
|
"eslint-plugin-zod": "4.7.0",
|
|
@@ -90,12 +90,12 @@
|
|
|
90
90
|
"@arethetypeswrong/cli": "0.18.4",
|
|
91
91
|
"@eslint/config-inspector": "3.0.4",
|
|
92
92
|
"@types/eslint-plugin-jsx-a11y": "6.10.1",
|
|
93
|
-
"@types/node": "26.0.
|
|
93
|
+
"@types/node": "26.0.1",
|
|
94
94
|
"actions-up": "1.14.3",
|
|
95
|
-
"eslint": "10.
|
|
95
|
+
"eslint": "10.6.0",
|
|
96
96
|
"eslint-typegen": "2.3.1",
|
|
97
97
|
"nano-staged": "1.0.2",
|
|
98
|
-
"prettier": "3.
|
|
98
|
+
"prettier": "3.9.1",
|
|
99
99
|
"publint": "0.3.21",
|
|
100
100
|
"serve": "14.2.6",
|
|
101
101
|
"simple-git-hooks": "2.13.1",
|
|
@@ -105,21 +105,21 @@
|
|
|
105
105
|
"unplugin-unused": "0.5.7"
|
|
106
106
|
},
|
|
107
107
|
"peerDependencies": {
|
|
108
|
-
"eslint": "^10.
|
|
108
|
+
"eslint": "^10.6.0"
|
|
109
109
|
},
|
|
110
110
|
"engines": {
|
|
111
111
|
"node": "^20.19.0 || ^22.13.0 || ^24.0.0 || ^26.0.0"
|
|
112
112
|
},
|
|
113
113
|
"devEngines": {
|
|
114
|
+
"packageManager": {
|
|
115
|
+
"name": "pnpm",
|
|
116
|
+
"version": "11.9.0",
|
|
117
|
+
"onFail": "warn"
|
|
118
|
+
},
|
|
114
119
|
"runtime": {
|
|
115
120
|
"name": "node",
|
|
116
121
|
"version": "^22.22.3 || ^24.15.0 || ^26.0.0",
|
|
117
122
|
"onFail": "warn"
|
|
118
|
-
},
|
|
119
|
-
"packageManager": {
|
|
120
|
-
"name": "pnpm",
|
|
121
|
-
"version": "11.8.0",
|
|
122
|
-
"onFail": "warn"
|
|
123
123
|
}
|
|
124
124
|
},
|
|
125
125
|
"publishConfig": {
|
|
@@ -128,7 +128,7 @@
|
|
|
128
128
|
"scripts": {
|
|
129
129
|
"git:gitmessage": "git config --local commit.template '.gitmessage'",
|
|
130
130
|
"update:actions": "actions-up --yes",
|
|
131
|
-
"update:deps": "pnpm update --latest --interactive && pnpm generate:types && pnpm generate:docs",
|
|
131
|
+
"update:deps": "pnpm update --latest --interactive && pnpm dedupe && pnpm generate:types && pnpm generate:docs",
|
|
132
132
|
"check:spell": "pnpx cspell . --gitignore --exclude='pnpm-lock.yaml' --cache --cache-location='./node_modules/.cache/.cspellcache'",
|
|
133
133
|
"inspect": "pnpm build:package && eslint-config-inspector",
|
|
134
134
|
"build:inspector": "eslint-config-inspector build --config=./scripts/configs/eslint.config.reference.ts --outDir=./netlify/eslint-config-inspector",
|
|
@@ -139,8 +139,8 @@
|
|
|
139
139
|
"build:package": "tsdown",
|
|
140
140
|
"watch:package": "tsdown --watch --publint=false",
|
|
141
141
|
"check:exports": "attw --pack --profile=esm-only",
|
|
142
|
-
"format": "prettier --write '**/*.{json,
|
|
143
|
-
"lint": "eslint --fix --cache --cache-location=./node_modules/.cache/.eslintcache",
|
|
142
|
+
"format": "prettier --write '**/*.{json,yaml}' '!pnpm-lock.yaml' --cache",
|
|
143
|
+
"lint": "eslint --fix --max-warnings=0 --cache --cache-location=./node_modules/.cache/.eslintcache",
|
|
144
144
|
"ci:validate": "pnpm generate:types && pnpm format && pnpm build:package && pnpm lint && pnpm check:types && pnpm build:inspector && pnpm build:package && pnpm check:exports"
|
|
145
145
|
}
|
|
146
146
|
}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { isEnabled } from "../utils/isEnabled.mjs";
|
|
2
|
-
import { defaultOptions } from "../helpers/options/defaultOptions.mjs";
|
|
3
|
-
//#region src/rules/vueAccessibility.ts
|
|
4
|
-
function getVueAccessibilityRules(options) {
|
|
5
|
-
const { vue, nuxt } = options.configs;
|
|
6
|
-
const { imageComponents: userImageComponents, anchorComponents: userAnchorComponents, accessibleChildComponents: userAccessibleChildComponents } = isEnabled(vue) && isEnabled(vue.accessibility) ? vue.accessibility : defaultOptions.configs.vue.accessibility;
|
|
7
|
-
const isNuxtUIEnabled = isEnabled(nuxt) ? nuxt.ui : void 0;
|
|
8
|
-
const nuxtUIPrefix = isEnabled(nuxt) && isEnabled(nuxt.ui) ? nuxt.ui.prefix : defaultOptions.configs.nuxt.ui.prefix;
|
|
9
|
-
return {
|
|
10
|
-
"vuejs-accessibility/alt-text": ["error", { img: userImageComponents }],
|
|
11
|
-
"vuejs-accessibility/anchor-has-content": ["error", {
|
|
12
|
-
components: userAnchorComponents,
|
|
13
|
-
accessibleChildren: userAccessibleChildComponents
|
|
14
|
-
}],
|
|
15
|
-
"vuejs-accessibility/aria-props": "error",
|
|
16
|
-
"vuejs-accessibility/aria-role": "error",
|
|
17
|
-
"vuejs-accessibility/aria-unsupported-elements": "error",
|
|
18
|
-
"vuejs-accessibility/form-control-has-label": ["error", { labelComponents: isNuxtUIEnabled ? [`${nuxtUIPrefix}FormField`] : void 0 }],
|
|
19
|
-
"vuejs-accessibility/heading-has-content": "error",
|
|
20
|
-
"vuejs-accessibility/iframe-has-title": "error",
|
|
21
|
-
"vuejs-accessibility/interactive-supports-focus": "error",
|
|
22
|
-
"vuejs-accessibility/label-has-for": ["error", {
|
|
23
|
-
allowChildren: true,
|
|
24
|
-
required: { some: ["nesting", "id"] },
|
|
25
|
-
controlComponents: [
|
|
26
|
-
"input",
|
|
27
|
-
"output",
|
|
28
|
-
"meter",
|
|
29
|
-
"select",
|
|
30
|
-
"textarea",
|
|
31
|
-
"progress"
|
|
32
|
-
]
|
|
33
|
-
}],
|
|
34
|
-
"vuejs-accessibility/media-has-caption": "error",
|
|
35
|
-
"vuejs-accessibility/no-access-key": "warn",
|
|
36
|
-
"vuejs-accessibility/no-aria-hidden-on-focusable": "error",
|
|
37
|
-
"vuejs-accessibility/no-autofocus": "warn",
|
|
38
|
-
"vuejs-accessibility/no-distracting-elements": "warn",
|
|
39
|
-
"vuejs-accessibility/no-redundant-roles": "warn",
|
|
40
|
-
"vuejs-accessibility/no-role-presentation-on-focusable": "error",
|
|
41
|
-
"vuejs-accessibility/no-static-element-interactions": "error",
|
|
42
|
-
"vuejs-accessibility/role-has-required-aria-props": "error",
|
|
43
|
-
"vuejs-accessibility/tabindex-no-positive": "error"
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
//#endregion
|
|
47
|
-
export { getVueAccessibilityRules };
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { RuleOptions } from "../eslintRules.mjs";
|
|
2
|
-
|
|
3
|
-
//#region src/types/options/vueAccessibility.d.ts
|
|
4
|
-
type AnchorHasContentRuleOptions = RuleOptions<'vuejs-accessibility/anchor-has-content'>;
|
|
5
|
-
interface VueAccessibilityOptions {
|
|
6
|
-
/**
|
|
7
|
-
* Names of components that should be considered accessible child elements.
|
|
8
|
-
*
|
|
9
|
-
* New items extend the defaults instead of overriding them.
|
|
10
|
-
*
|
|
11
|
-
* @default ['img', 'picture', 'NuxtImg', 'NuxtPicture', 'UBadge']
|
|
12
|
-
*
|
|
13
|
-
* @see [vuejs-accessibility/anchor-has-content: `accessibleChildren` option](https://vue-a11y.github.io/eslint-plugin-vuejs-accessibility/rules/anchor-has-content#%F0%9F%94%A7-options)
|
|
14
|
-
*/
|
|
15
|
-
accessibleChildComponents?: AnchorHasContentRuleOptions['accessibleChildren'];
|
|
16
|
-
/**
|
|
17
|
-
* Names of components that render an `<a>` element.
|
|
18
|
-
*
|
|
19
|
-
* New items extend the defaults instead of overriding them.
|
|
20
|
-
*
|
|
21
|
-
* @default ['RouterLink', 'NuxtLink', 'ULink']
|
|
22
|
-
*
|
|
23
|
-
* @see [vuejs-accessibility/anchor-has-content: `components` option](https://vue-a11y.github.io/eslint-plugin-vuejs-accessibility/rules/anchor-has-content#%F0%9F%94%A7-options)
|
|
24
|
-
*/
|
|
25
|
-
anchorComponents?: AnchorHasContentRuleOptions['components'];
|
|
26
|
-
/**
|
|
27
|
-
* Names of components that render an `<img>` element.
|
|
28
|
-
*
|
|
29
|
-
* New items extend the defaults instead of overriding them.
|
|
30
|
-
*
|
|
31
|
-
* @default ['NuxtImg']
|
|
32
|
-
*
|
|
33
|
-
* @see [vuejs-accessibility/alt-text: `img` option](https://vue-a11y.github.io/eslint-plugin-vuejs-accessibility/rules/alt-text#%F0%9F%94%A7-options)
|
|
34
|
-
*/
|
|
35
|
-
imageComponents?: RuleOptions<'vuejs-accessibility/alt-text'>['img'];
|
|
36
|
-
}
|
|
37
|
-
//#endregion
|
|
38
|
-
export type { VueAccessibilityOptions };
|