@azat-io/eslint-config 2.72.0 → 2.73.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.
@@ -1,54 +1,46 @@
1
1
  import jsxA11y from "eslint-plugin-jsx-a11y";
2
2
  function a11y(config) {
3
- if (!config.react && !config.qwik) {
4
- return {};
5
- }
6
- let files = ["**/*.jsx"];
7
- if (config.typescript) {
8
- files.push("**/*.tsx");
9
- }
10
- return {
11
- name: "azat-io/a11y/rules",
12
- files,
13
- plugins: {
14
- "jsx-a11y": jsxA11y
15
- },
16
- rules: {
17
- "jsx-a11y/alt-text": "error",
18
- "jsx-a11y/anchor-has-content": "error",
19
- "jsx-a11y/anchor-is-valid": "error",
20
- "jsx-a11y/aria-activedescendant-has-tabindex": "error",
21
- "jsx-a11y/aria-props": "error",
22
- "jsx-a11y/aria-proptypes": "error",
23
- "jsx-a11y/aria-role": "error",
24
- "jsx-a11y/aria-unsupported-elements": "error",
25
- "jsx-a11y/autocomplete-valid": "error",
26
- "jsx-a11y/heading-has-content": "error",
27
- "jsx-a11y/html-has-lang": "error",
28
- "jsx-a11y/iframe-has-title": "error",
29
- "jsx-a11y/img-redundant-alt": "error",
30
- "jsx-a11y/interactive-supports-focus": "error",
31
- "jsx-a11y/label-has-associated-control": "error",
32
- "jsx-a11y/lang": "error",
33
- "jsx-a11y/media-has-caption": "error",
34
- "jsx-a11y/mouse-events-have-key-events": "error",
35
- "jsx-a11y/no-access-key": "error",
36
- "jsx-a11y/no-aria-hidden-on-focusable": "error",
37
- "jsx-a11y/no-autofocus": "error",
38
- "jsx-a11y/no-interactive-element-to-noninteractive-role": "error",
39
- "jsx-a11y/no-noninteractive-element-interactions": "error",
40
- "jsx-a11y/no-noninteractive-element-to-interactive-role": "error",
41
- "jsx-a11y/no-noninteractive-tabindex": "error",
42
- "jsx-a11y/no-redundant-roles": "error",
43
- "jsx-a11y/no-static-element-interactions": "error",
44
- "jsx-a11y/prefer-tag-over-role": "error",
45
- "jsx-a11y/role-has-required-aria-props": "error",
46
- "jsx-a11y/role-supports-aria-props": "error",
47
- "jsx-a11y/scope": "error",
48
- "jsx-a11y/tabindex-no-positive": "error"
49
- }
50
- };
3
+ if (!config.react && !config.qwik) return {};
4
+ let files = ["**/*.jsx"];
5
+ if (config.typescript) files.push("**/*.tsx");
6
+ return {
7
+ name: "azat-io/a11y/rules",
8
+ files,
9
+ plugins: { "jsx-a11y": jsxA11y },
10
+ rules: {
11
+ "jsx-a11y/alt-text": "error",
12
+ "jsx-a11y/anchor-has-content": "error",
13
+ "jsx-a11y/anchor-is-valid": "error",
14
+ "jsx-a11y/aria-activedescendant-has-tabindex": "error",
15
+ "jsx-a11y/aria-props": "error",
16
+ "jsx-a11y/aria-proptypes": "error",
17
+ "jsx-a11y/aria-role": "error",
18
+ "jsx-a11y/aria-unsupported-elements": "error",
19
+ "jsx-a11y/autocomplete-valid": "error",
20
+ "jsx-a11y/heading-has-content": "error",
21
+ "jsx-a11y/html-has-lang": "error",
22
+ "jsx-a11y/iframe-has-title": "error",
23
+ "jsx-a11y/img-redundant-alt": "error",
24
+ "jsx-a11y/interactive-supports-focus": "error",
25
+ "jsx-a11y/label-has-associated-control": "error",
26
+ "jsx-a11y/lang": "error",
27
+ "jsx-a11y/media-has-caption": "error",
28
+ "jsx-a11y/mouse-events-have-key-events": "error",
29
+ "jsx-a11y/no-access-key": "error",
30
+ "jsx-a11y/no-aria-hidden-on-focusable": "error",
31
+ "jsx-a11y/no-autofocus": "error",
32
+ "jsx-a11y/no-interactive-element-to-noninteractive-role": "error",
33
+ "jsx-a11y/no-noninteractive-element-interactions": "error",
34
+ "jsx-a11y/no-noninteractive-element-to-interactive-role": "error",
35
+ "jsx-a11y/no-noninteractive-tabindex": "error",
36
+ "jsx-a11y/no-redundant-roles": "error",
37
+ "jsx-a11y/no-static-element-interactions": "error",
38
+ "jsx-a11y/prefer-tag-over-role": "error",
39
+ "jsx-a11y/role-has-required-aria-props": "error",
40
+ "jsx-a11y/role-supports-aria-props": "error",
41
+ "jsx-a11y/scope": "error",
42
+ "jsx-a11y/tabindex-no-positive": "error"
43
+ }
44
+ };
51
45
  }
52
- export {
53
- a11y
54
- };
46
+ export { a11y };
@@ -1,99 +1,85 @@
1
- import path from "node:path";
2
1
  import { interopDefault } from "../utilities.js";
2
+ import path from "node:path";
3
3
  async function astro(config) {
4
- if (!config.astro) {
5
- return {};
6
- }
7
- let [astroPlugin, astroParser] = await Promise.all([
8
- interopDefault(import("eslint-plugin-astro")),
9
- interopDefault(import("astro-eslint-parser"))
10
- ]);
11
- let files = ["**/*.astro"];
12
- let additionalParserOptions = {};
13
- if (config.typescript) {
14
- let { parser: typescriptParser } = await interopDefault(
15
- import("typescript-eslint")
16
- );
17
- additionalParserOptions = {
18
- ...additionalParserOptions,
19
- parser: typescriptParser,
20
- project: path.join(process.cwd(), "tsconfig.json"),
21
- projectService: false,
22
- tsconfigRootDir: process.cwd()
23
- };
24
- }
25
- return {
26
- name: "azat-io/astro/rules",
27
- files,
28
- languageOptions: {
29
- parser: astroParser,
30
- parserOptions: {
31
- ecmaVersion: "latest",
32
- extraFileExtensions: [".astro"],
33
- sourceType: "module",
34
- ...additionalParserOptions
35
- }
36
- },
37
- plugins: {
38
- astro: astroPlugin
39
- },
40
- rules: {
41
- "astro/jsx-a11y/alt-text": "error",
42
- "astro/jsx-a11y/anchor-has-content": "error",
43
- "astro/jsx-a11y/anchor-is-valid": "error",
44
- "astro/jsx-a11y/aria-activedescendant-has-tabindex": "error",
45
- "astro/jsx-a11y/aria-props": "error",
46
- "astro/jsx-a11y/aria-proptypes": "error",
47
- "astro/jsx-a11y/aria-role": "error",
48
- "astro/jsx-a11y/aria-unsupported-elements": "error",
49
- "astro/jsx-a11y/autocomplete-valid": "error",
50
- "astro/jsx-a11y/heading-has-content": "error",
51
- "astro/jsx-a11y/html-has-lang": "error",
52
- "astro/jsx-a11y/iframe-has-title": "error",
53
- "astro/jsx-a11y/img-redundant-alt": "error",
54
- "astro/jsx-a11y/interactive-supports-focus": "error",
55
- "astro/jsx-a11y/label-has-associated-control": "error",
56
- "astro/jsx-a11y/lang": "error",
57
- "astro/jsx-a11y/media-has-caption": "error",
58
- "astro/jsx-a11y/mouse-events-have-key-events": "error",
59
- "astro/jsx-a11y/no-access-key": "error",
60
- "astro/jsx-a11y/no-aria-hidden-on-focusable": "error",
61
- "astro/jsx-a11y/no-autofocus": "error",
62
- "astro/jsx-a11y/no-interactive-element-to-noninteractive-role": "error",
63
- "astro/jsx-a11y/no-noninteractive-element-interactions": "error",
64
- "astro/jsx-a11y/no-noninteractive-element-to-interactive-role": "error",
65
- "astro/jsx-a11y/no-noninteractive-tabindex": "error",
66
- "astro/jsx-a11y/no-redundant-roles": "error",
67
- "astro/jsx-a11y/no-static-element-interactions": "error",
68
- "astro/jsx-a11y/prefer-tag-over-role": "error",
69
- "astro/jsx-a11y/role-has-required-aria-props": "error",
70
- "astro/jsx-a11y/role-supports-aria-props": "error",
71
- "astro/jsx-a11y/scope": "error",
72
- "astro/jsx-a11y/tabindex-no-positive": "error",
73
- "astro/missing-client-only-directive-value": "error",
74
- "astro/no-conflict-set-directives": "error",
75
- "astro/no-deprecated-astro-canonicalurl": "error",
76
- "astro/no-deprecated-astro-fetchcontent": "error",
77
- "astro/no-deprecated-astro-resolve": "error",
78
- "astro/no-deprecated-getentrybyslug": "error",
79
- "astro/no-exports-from-components": "error",
80
- "astro/no-set-text-directive": "error",
81
- "astro/no-unused-define-vars-in-style": "error",
82
- "astro/prefer-class-list-directive": "error",
83
- "astro/prefer-object-class-list": "error",
84
- "astro/prefer-split-class-list": "error",
85
- "astro/sort-attributes": [
86
- "error",
87
- {
88
- ignoreCase: true,
89
- order: "desc",
90
- type: "line-length"
91
- }
92
- ],
93
- "astro/valid-compile": "error"
94
- }
95
- };
4
+ if (!config.astro) return {};
5
+ let [astroPlugin, astroParser] = await Promise.all([interopDefault(import("eslint-plugin-astro")), interopDefault(import("astro-eslint-parser"))]);
6
+ let files = ["**/*.astro"];
7
+ let additionalParserOptions = {};
8
+ if (config.typescript) {
9
+ let { parser: typescriptParser } = await interopDefault(import("typescript-eslint"));
10
+ additionalParserOptions = {
11
+ ...additionalParserOptions,
12
+ parser: typescriptParser,
13
+ project: path.join(process.cwd(), "tsconfig.json"),
14
+ projectService: false,
15
+ tsconfigRootDir: process.cwd()
16
+ };
17
+ }
18
+ return {
19
+ name: "azat-io/astro/rules",
20
+ files,
21
+ languageOptions: {
22
+ parser: astroParser,
23
+ parserOptions: {
24
+ ecmaVersion: "latest",
25
+ extraFileExtensions: [".astro"],
26
+ sourceType: "module",
27
+ ...additionalParserOptions
28
+ }
29
+ },
30
+ plugins: { astro: astroPlugin },
31
+ rules: {
32
+ "astro/jsx-a11y/alt-text": "error",
33
+ "astro/jsx-a11y/anchor-has-content": "error",
34
+ "astro/jsx-a11y/anchor-is-valid": "error",
35
+ "astro/jsx-a11y/aria-activedescendant-has-tabindex": "error",
36
+ "astro/jsx-a11y/aria-props": "error",
37
+ "astro/jsx-a11y/aria-proptypes": "error",
38
+ "astro/jsx-a11y/aria-role": "error",
39
+ "astro/jsx-a11y/aria-unsupported-elements": "error",
40
+ "astro/jsx-a11y/autocomplete-valid": "error",
41
+ "astro/jsx-a11y/heading-has-content": "error",
42
+ "astro/jsx-a11y/html-has-lang": "error",
43
+ "astro/jsx-a11y/iframe-has-title": "error",
44
+ "astro/jsx-a11y/img-redundant-alt": "error",
45
+ "astro/jsx-a11y/interactive-supports-focus": "error",
46
+ "astro/jsx-a11y/label-has-associated-control": "error",
47
+ "astro/jsx-a11y/lang": "error",
48
+ "astro/jsx-a11y/media-has-caption": "error",
49
+ "astro/jsx-a11y/mouse-events-have-key-events": "error",
50
+ "astro/jsx-a11y/no-access-key": "error",
51
+ "astro/jsx-a11y/no-aria-hidden-on-focusable": "error",
52
+ "astro/jsx-a11y/no-autofocus": "error",
53
+ "astro/jsx-a11y/no-interactive-element-to-noninteractive-role": "error",
54
+ "astro/jsx-a11y/no-noninteractive-element-interactions": "error",
55
+ "astro/jsx-a11y/no-noninteractive-element-to-interactive-role": "error",
56
+ "astro/jsx-a11y/no-noninteractive-tabindex": "error",
57
+ "astro/jsx-a11y/no-redundant-roles": "error",
58
+ "astro/jsx-a11y/no-static-element-interactions": "error",
59
+ "astro/jsx-a11y/prefer-tag-over-role": "error",
60
+ "astro/jsx-a11y/role-has-required-aria-props": "error",
61
+ "astro/jsx-a11y/role-supports-aria-props": "error",
62
+ "astro/jsx-a11y/scope": "error",
63
+ "astro/jsx-a11y/tabindex-no-positive": "error",
64
+ "astro/missing-client-only-directive-value": "error",
65
+ "astro/no-conflict-set-directives": "error",
66
+ "astro/no-deprecated-astro-canonicalurl": "error",
67
+ "astro/no-deprecated-astro-fetchcontent": "error",
68
+ "astro/no-deprecated-astro-resolve": "error",
69
+ "astro/no-deprecated-getentrybyslug": "error",
70
+ "astro/no-exports-from-components": "error",
71
+ "astro/no-set-text-directive": "error",
72
+ "astro/no-unused-define-vars-in-style": "error",
73
+ "astro/prefer-class-list-directive": "error",
74
+ "astro/prefer-object-class-list": "error",
75
+ "astro/prefer-split-class-list": "error",
76
+ "astro/sort-attributes": ["error", {
77
+ ignoreCase: true,
78
+ order: "desc",
79
+ type: "line-length"
80
+ }],
81
+ "astro/valid-compile": "error"
82
+ }
83
+ };
96
84
  }
97
- export {
98
- astro
99
- };
85
+ export { astro };