@jakubmazanec/eslint-config 2.0.4-unstable.ee5adfc → 3.0.0-next.2fa8a2c

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.
Files changed (137) hide show
  1. package/LICENSE.md +0 -2
  2. package/README.md +1 -5
  3. package/build/constants.js +60 -0
  4. package/build/constants.js.map +7 -0
  5. package/build/main.js +31 -0
  6. package/build/main.js.map +7 -0
  7. package/build/presets/base.js +169 -0
  8. package/build/presets/base.js.map +7 -0
  9. package/build/presets/nodejs.js +47 -0
  10. package/build/presets/nodejs.js.map +7 -0
  11. package/build/presets/prettier.js +33 -0
  12. package/build/presets/prettier.js.map +7 -0
  13. package/build/resolvers/graphql.js +38 -0
  14. package/build/resolvers/graphql.js.map +7 -0
  15. package/build/rules/a11y.js +106 -0
  16. package/build/rules/a11y.js.map +7 -0
  17. package/build/rules/eslint-comments.js +46 -0
  18. package/build/rules/eslint-comments.js.map +7 -0
  19. package/build/rules/eslint.js +549 -0
  20. package/build/rules/eslint.js.map +7 -0
  21. package/build/rules/import.js +140 -0
  22. package/build/rules/import.js.map +7 -0
  23. package/build/rules/node.js +105 -0
  24. package/build/rules/node.js.map +7 -0
  25. package/build/rules/prettier.js +32 -0
  26. package/build/rules/prettier.js.map +7 -0
  27. package/build/rules/promise.js +63 -0
  28. package/build/rules/promise.js.map +7 -0
  29. package/build/rules/react-hooks.js +30 -0
  30. package/build/rules/react-hooks.js.map +7 -0
  31. package/build/rules/react.js +295 -0
  32. package/build/rules/react.js.map +7 -0
  33. package/build/rules/simple-import-sort.js +38 -0
  34. package/build/rules/simple-import-sort.js.map +7 -0
  35. package/build/rules/stylistic.js +215 -0
  36. package/build/rules/stylistic.js.map +7 -0
  37. package/build/rules/testing-library.js +82 -0
  38. package/build/rules/testing-library.js.map +7 -0
  39. package/build/rules/typescript.js +527 -0
  40. package/build/rules/typescript.js.map +7 -0
  41. package/build/rules/unicorn.js +263 -0
  42. package/build/rules/unicorn.js.map +7 -0
  43. package/build/rules/vitest.js +131 -0
  44. package/build/rules/vitest.js.map +7 -0
  45. package/package.json +35 -32
  46. package/{src → source}/presets/base.ts +28 -46
  47. package/source/presets/nodejs.ts +27 -0
  48. package/{src → source}/rules/a11y.ts +3 -0
  49. package/{src → source}/rules/eslint.ts +3 -76
  50. package/{src → source}/rules/import.ts +4 -2
  51. package/{src → source}/rules/react.ts +36 -12
  52. package/source/rules/simple-import-sort.ts +17 -0
  53. package/source/rules/stylistic.ts +103 -0
  54. package/{src → source}/rules/testing-library.ts +6 -6
  55. package/{src → source}/rules/typescript.ts +29 -42
  56. package/{src → source}/rules/unicorn.ts +7 -2
  57. package/source/rules/vitest.ts +59 -0
  58. package/dist/constants.js +0 -53
  59. package/dist/constants.js.map +0 -1
  60. package/dist/main.js +0 -12
  61. package/dist/main.js.map +0 -1
  62. package/dist/presets/base.js +0 -178
  63. package/dist/presets/base.js.map +0 -1
  64. package/dist/presets/nextjs.d.ts +0 -3
  65. package/dist/presets/nextjs.js +0 -13
  66. package/dist/presets/nextjs.js.map +0 -1
  67. package/dist/presets/nodejs.js +0 -103
  68. package/dist/presets/nodejs.js.map +0 -1
  69. package/dist/presets/prettier.js +0 -16
  70. package/dist/presets/prettier.js.map +0 -1
  71. package/dist/resolvers/graphql.js +0 -30
  72. package/dist/resolvers/graphql.js.map +0 -1
  73. package/dist/rules/a11y.js +0 -77
  74. package/dist/rules/a11y.js.map +0 -1
  75. package/dist/rules/eslint-comments.js +0 -34
  76. package/dist/rules/eslint-comments.js.map +0 -1
  77. package/dist/rules/eslint.js +0 -559
  78. package/dist/rules/eslint.js.map +0 -1
  79. package/dist/rules/import.js +0 -96
  80. package/dist/rules/import.js.map +0 -1
  81. package/dist/rules/jest-formatting.js +0 -14
  82. package/dist/rules/jest-formatting.js.map +0 -1
  83. package/dist/rules/jest.js +0 -68
  84. package/dist/rules/jest.js.map +0 -1
  85. package/dist/rules/nextjs.js +0 -32
  86. package/dist/rules/nextjs.js.map +0 -1
  87. package/dist/rules/node.js +0 -71
  88. package/dist/rules/node.js.map +0 -1
  89. package/dist/rules/prettier.js +0 -19
  90. package/dist/rules/prettier.js.map +0 -1
  91. package/dist/rules/promise.js +0 -33
  92. package/dist/rules/promise.js.map +0 -1
  93. package/dist/rules/react-hooks.js +0 -15
  94. package/dist/rules/react-hooks.js.map +0 -1
  95. package/dist/rules/react.js +0 -235
  96. package/dist/rules/react.js.map +0 -1
  97. package/dist/rules/testing-library.js +0 -43
  98. package/dist/rules/testing-library.js.map +0 -1
  99. package/dist/rules/typescript.js +0 -467
  100. package/dist/rules/typescript.js.map +0 -1
  101. package/dist/rules/unicorn.js +0 -142
  102. package/dist/rules/unicorn.js.map +0 -1
  103. package/src/presets/nextjs.ts +0 -12
  104. package/src/presets/nodejs.ts +0 -90
  105. package/src/rules/jest-formatting.ts +0 -8
  106. package/src/rules/jest.ts +0 -57
  107. package/src/rules/nextjs.ts +0 -26
  108. /package/{dist → build}/constants.d.ts +0 -0
  109. /package/{dist → build}/main.d.ts +0 -0
  110. /package/{dist → build}/presets/base.d.ts +0 -0
  111. /package/{dist → build}/presets/nodejs.d.ts +0 -0
  112. /package/{dist → build}/presets/prettier.d.ts +0 -0
  113. /package/{dist → build}/resolvers/graphql.d.ts +0 -0
  114. /package/{dist → build}/rules/a11y.d.ts +0 -0
  115. /package/{dist → build}/rules/eslint-comments.d.ts +0 -0
  116. /package/{dist → build}/rules/eslint.d.ts +0 -0
  117. /package/{dist → build}/rules/import.d.ts +0 -0
  118. /package/{dist → build}/rules/node.d.ts +0 -0
  119. /package/{dist → build}/rules/prettier.d.ts +0 -0
  120. /package/{dist → build}/rules/promise.d.ts +0 -0
  121. /package/{dist → build}/rules/react-hooks.d.ts +0 -0
  122. /package/{dist → build}/rules/react.d.ts +0 -0
  123. /package/{dist/rules/jest-formatting.d.ts → build/rules/simple-import-sort.d.ts} +0 -0
  124. /package/{dist/rules/jest.d.ts → build/rules/stylistic.d.ts} +0 -0
  125. /package/{dist → build}/rules/testing-library.d.ts +0 -0
  126. /package/{dist → build}/rules/typescript.d.ts +0 -0
  127. /package/{dist → build}/rules/unicorn.d.ts +0 -0
  128. /package/{dist/rules/nextjs.d.ts → build/rules/vitest.d.ts} +0 -0
  129. /package/{src → source}/constants.ts +0 -0
  130. /package/{src → source}/main.ts +0 -0
  131. /package/{src → source}/presets/prettier.ts +0 -0
  132. /package/{src → source}/resolvers/graphql.ts +0 -0
  133. /package/{src → source}/rules/eslint-comments.ts +0 -0
  134. /package/{src → source}/rules/node.ts +0 -0
  135. /package/{src → source}/rules/prettier.ts +0 -0
  136. /package/{src → source}/rules/promise.ts +0 -0
  137. /package/{src → source}/rules/react-hooks.ts +0 -0
package/LICENSE.md CHANGED
@@ -1,7 +1,5 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2023 Jakub Mazanec
4
-
5
3
  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
6
4
  associated documentation files (the "Software"), to deal in the Software without restriction,
7
5
  including without limitation the rights to use, copy, modify, merge, publish, distribute,
package/README.md CHANGED
@@ -16,17 +16,13 @@ npm install @jakubmazanec/eslint-config
16
16
 
17
17
  #### Prerequisites
18
18
 
19
- - Node.js 16 or later
19
+ - Node.js 20 or later
20
20
  - TypeScript 5 or later
21
21
 
22
22
  ## Usage
23
23
 
24
24
  🚧 This section is under development. Please check back later for updates.
25
25
 
26
- ## Documentation
27
-
28
- See [API reference](./docs) for auto-generated documentation.
29
-
30
26
  ## Contributing
31
27
 
32
28
  If you want to contribute, see [CONTRIBUTING](./CONTRIBUTING.md) for details.
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var constants_exports = {};
20
+ __export(constants_exports, {
21
+ ASSET_EXTENSIONS_REGEXP: () => ASSET_EXTENSIONS_REGEXP,
22
+ CSS_EXTENSIONS_REGEXP: () => CSS_EXTENSIONS_REGEXP,
23
+ GRAPHQL_EXTENSIONS_REGEXP: () => GRAPHQL_EXTENSIONS_REGEXP,
24
+ JS_AND_TS_EXTENSIONS: () => JS_AND_TS_EXTENSIONS,
25
+ JS_AND_TS_EXTENSIONS_GLOB_PART: () => JS_AND_TS_EXTENSIONS_GLOB_PART,
26
+ JS_AND_TS_EXTENSIONS_REGEXP: () => JS_AND_TS_EXTENSIONS_REGEXP,
27
+ JS_EXTENSIONS_GLOB_PART: () => JS_EXTENSIONS_GLOB_PART,
28
+ TS_EXTENSIONS_GLOB_PART: () => TS_EXTENSIONS_GLOB_PART
29
+ });
30
+ module.exports = __toCommonJS(constants_exports);
31
+ const JS_AND_TS_EXTENSIONS = [
32
+ ".ts",
33
+ ".tsx",
34
+ ".cts",
35
+ ".mts",
36
+ ".js",
37
+ ".jsx",
38
+ ".cjs",
39
+ ".mjs",
40
+ ".json"
41
+ ];
42
+ const JS_EXTENSIONS_GLOB_PART = "{js,jsx,cjs,mjs}";
43
+ const TS_EXTENSIONS_GLOB_PART = "{ts,tsx,cts,mts}";
44
+ const JS_AND_TS_EXTENSIONS_GLOB_PART = "{js,jsx,cjs,mjs,ts,tsx,cts,mts}";
45
+ const JS_AND_TS_EXTENSIONS_REGEXP = /\.(js|jsx|cjs|mjs|ts|tsx|cts|mts)$/;
46
+ const ASSET_EXTENSIONS_REGEXP = /\.(ttf|eot|otf|svg|woff|woff2|mp3|png|jpg|jpeg|gif|ico)$/;
47
+ const CSS_EXTENSIONS_REGEXP = /\.(css|scss)$/;
48
+ const GRAPHQL_EXTENSIONS_REGEXP = /\.(gql|graphql)$/;
49
+ // Annotate the CommonJS export names for ESM import in node:
50
+ 0 && (module.exports = {
51
+ ASSET_EXTENSIONS_REGEXP,
52
+ CSS_EXTENSIONS_REGEXP,
53
+ GRAPHQL_EXTENSIONS_REGEXP,
54
+ JS_AND_TS_EXTENSIONS,
55
+ JS_AND_TS_EXTENSIONS_GLOB_PART,
56
+ JS_AND_TS_EXTENSIONS_REGEXP,
57
+ JS_EXTENSIONS_GLOB_PART,
58
+ TS_EXTENSIONS_GLOB_PART
59
+ });
60
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../source/constants.ts"],
4
+ "sourcesContent": ["export const JS_AND_TS_EXTENSIONS = [\n '.ts',\n '.tsx',\n '.cts',\n '.mts',\n '.js',\n '.jsx',\n '.cjs',\n '.mjs',\n '.json',\n];\n\nexport const JS_EXTENSIONS_GLOB_PART = '{js,jsx,cjs,mjs}';\nexport const TS_EXTENSIONS_GLOB_PART = '{ts,tsx,cts,mts}';\nexport const JS_AND_TS_EXTENSIONS_GLOB_PART = '{js,jsx,cjs,mjs,ts,tsx,cts,mts}';\n\nexport const JS_AND_TS_EXTENSIONS_REGEXP = /\\.(js|jsx|cjs|mjs|ts|tsx|cts|mts)$/;\nexport const ASSET_EXTENSIONS_REGEXP = /\\.(ttf|eot|otf|svg|woff|woff2|mp3|png|jpg|jpeg|gif|ico)$/;\nexport const CSS_EXTENSIONS_REGEXP = /\\.(css|scss)$/;\nexport const GRAPHQL_EXTENSIONS_REGEXP = /\\.(gql|graphql)$/;\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,MAAM,uBAAuB;AAAA,EAClC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEO,MAAM,0BAA0B;AAChC,MAAM,0BAA0B;AAChC,MAAM,iCAAiC;AAEvC,MAAM,8BAA8B;AACpC,MAAM,0BAA0B;AAChC,MAAM,wBAAwB;AAC9B,MAAM,4BAA4B;",
6
+ "names": []
7
+ }
package/build/main.js ADDED
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from === "object" || typeof from === "function") {
10
+ for (let key of __getOwnPropNames(from))
11
+ if (!__hasOwnProp.call(to, key) && key !== except)
12
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
13
+ }
14
+ return to;
15
+ };
16
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
17
+ // If the importer is in node compatibility mode or this is not an ESM
18
+ // file that has been converted to a CommonJS file using a Babel-
19
+ // compatible transform (i.e. "__esModule" has not been set), then set
20
+ // "default" to the CommonJS "module.exports" for node compatibility.
21
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
+ mod
23
+ ));
24
+ let config = {
25
+ extends: [require.resolve("./presets/base.js")],
26
+ reportUnusedDisableDirectives: true,
27
+ // We can't define rules here otherwise they override the ones in the extending configs above. This is bad for actual `overrides`!
28
+ rules: {}
29
+ };
30
+ module.exports = config;
31
+ //# sourceMappingURL=main.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../source/main.ts"],
4
+ "sourcesContent": ["import type eslint from 'eslint';\n\nlet config: eslint.Linter.Config = {\n extends: [require.resolve('./presets/base.js')],\n\n reportUnusedDisableDirectives: true,\n\n // We can't define rules here otherwise they override the ones in the extending configs above. This is bad for actual `overrides`!\n rules: {},\n};\n\nexport = config;\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAEA,IAAI,SAA+B;AAAA,EACjC,SAAS,CAAC,gBAAgB,mBAAmB,CAAC;AAAA,EAE9C,+BAA+B;AAAA;AAAA,EAG/B,OAAO,CAAC;AACV;AAEA,iBAAS;",
6
+ "names": []
7
+ }
@@ -0,0 +1,169 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from === "object" || typeof from === "function") {
10
+ for (let key of __getOwnPropNames(from))
11
+ if (!__hasOwnProp.call(to, key) && key !== except)
12
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
13
+ }
14
+ return to;
15
+ };
16
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
17
+ // If the importer is in node compatibility mode or this is not an ESM
18
+ // file that has been converted to a CommonJS file using a Babel-
19
+ // compatible transform (i.e. "__esModule" has not been set), then set
20
+ // "default" to the CommonJS "module.exports" for node compatibility.
21
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
+ mod
23
+ ));
24
+ var import_constants = require("../constants");
25
+ var import_a11y = __toESM(require("../rules/a11y"));
26
+ var import_eslint = __toESM(require("../rules/eslint"));
27
+ var import_eslint_comments = __toESM(require("../rules/eslint-comments"));
28
+ var import_import = __toESM(require("../rules/import"));
29
+ var import_promise = __toESM(require("../rules/promise"));
30
+ var import_react = __toESM(require("../rules/react"));
31
+ var import_react_hooks = __toESM(require("../rules/react-hooks"));
32
+ var import_simple_import_sort = __toESM(require("../rules/simple-import-sort"));
33
+ var import_stylistic = __toESM(require("../rules/stylistic"));
34
+ var import_testing_library = __toESM(require("../rules/testing-library"));
35
+ var import_typescript = __toESM(require("../rules/typescript"));
36
+ var import_unicorn = __toESM(require("../rules/unicorn"));
37
+ var import_vitest = __toESM(require("../rules/vitest"));
38
+ const config = {
39
+ parserOptions: {
40
+ ecmaVersion: "latest",
41
+ sourceType: "module",
42
+ ecmaFeatures: {
43
+ jsx: true
44
+ }
45
+ },
46
+ plugins: [
47
+ "@stylistic",
48
+ "eslint-comments",
49
+ "import",
50
+ "jsx-a11y",
51
+ "promise",
52
+ "react",
53
+ "react-hooks",
54
+ "simple-import-sort",
55
+ "unicorn"
56
+ ],
57
+ env: {
58
+ browser: true,
59
+ es2023: true,
60
+ serviceworker: true,
61
+ "shared-node-browser": true,
62
+ worker: true
63
+ },
64
+ settings: {
65
+ "import/ignore": [
66
+ "node_modules",
67
+ "\\.json$",
68
+ import_constants.ASSET_EXTENSIONS_REGEXP.source,
69
+ import_constants.CSS_EXTENSIONS_REGEXP.source,
70
+ import_constants.GRAPHQL_EXTENSIONS_REGEXP.source
71
+ ],
72
+ react: {
73
+ version: "detect"
74
+ },
75
+ propWrapperFunctions: ["forbidExtraProps", "exact", "Object.freeze"],
76
+ "jsx-a11y": {
77
+ polymorphicPropName: "as",
78
+ components: {
79
+ Button: "button"
80
+ }
81
+ }
82
+ },
83
+ rules: {
84
+ ...import_eslint.default,
85
+ ...import_stylistic.default,
86
+ ...import_eslint_comments.default,
87
+ ...import_promise.default,
88
+ ...import_import.default,
89
+ ...import_simple_import_sort.default,
90
+ ...import_react.default,
91
+ ...import_react_hooks.default,
92
+ ...import_a11y.default,
93
+ ...import_unicorn.default
94
+ },
95
+ overrides: [
96
+ {
97
+ files: [`*.test.${import_constants.JS_AND_TS_EXTENSIONS_GLOB_PART}`],
98
+ plugins: ["vitest", "testing-library"],
99
+ settings: {
100
+ "testing-library/custom-queries": "off",
101
+ "testing-library/custom-renders": "off",
102
+ "testing-library/utils-module": "off"
103
+ },
104
+ globals: {
105
+ jsdom: "readonly"
106
+ },
107
+ env: {
108
+ node: true
109
+ },
110
+ rules: {
111
+ ...import_vitest.default,
112
+ ...import_testing_library.default,
113
+ // override ESLint rules
114
+ "max-classes-per-file": "off",
115
+ // enforce a maximum number of classes per file
116
+ // override eslint-plugin-node rules
117
+ "node/no-sync": "off"
118
+ // disallow synchronous methods
119
+ }
120
+ },
121
+ {
122
+ files: [`*.${import_constants.TS_EXTENSIONS_GLOB_PART}`],
123
+ plugins: ["@typescript-eslint"],
124
+ parser: "@typescript-eslint/parser",
125
+ parserOptions: {
126
+ EXPERIMENTAL_useProjectService: true
127
+ },
128
+ settings: {
129
+ node: {
130
+ tryExtensions: import_constants.JS_AND_TS_EXTENSIONS
131
+ },
132
+ "import/resolver": {
133
+ typescript: {}
134
+ },
135
+ "import/parsers": {
136
+ "@typescript-eslint/parser": [".ts", ".tsx", ".mts", ".cts"]
137
+ }
138
+ },
139
+ rules: {
140
+ ...import_typescript.default,
141
+ // override eslint-plugin-import rules
142
+ "import/no-extraneous-dependencies": [
143
+ "error",
144
+ {
145
+ devDependencies: [
146
+ `**/*.test.${import_constants.JS_AND_TS_EXTENSIONS_GLOB_PART}`,
147
+ `tests/**/*.${import_constants.JS_AND_TS_EXTENSIONS_GLOB_PART}`,
148
+ `tools/**/*.${import_constants.JS_AND_TS_EXTENSIONS_GLOB_PART}`,
149
+ `./*.${import_constants.JS_AND_TS_EXTENSIONS_GLOB_PART}`
150
+ ],
151
+ optionalDependencies: false
152
+ }
153
+ ]
154
+ }
155
+ },
156
+ {
157
+ files: [`*.test.${import_constants.TS_EXTENSIONS_GLOB_PART}`],
158
+ rules: {
159
+ // override @typescript-eslint/eslint-plugin rules
160
+ "@typescript-eslint/ban-ts-comment": "off",
161
+ // bans // @ts-<directive> comments from being used
162
+ "@typescript-eslint/no-floating-promises": "off"
163
+ // requires Promise-like values to be handled appropriately
164
+ }
165
+ }
166
+ ]
167
+ };
168
+ module.exports = config;
169
+ //# sourceMappingURL=base.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../source/presets/base.ts"],
4
+ "sourcesContent": ["import type eslint from 'eslint';\n\nimport {\n ASSET_EXTENSIONS_REGEXP,\n CSS_EXTENSIONS_REGEXP,\n GRAPHQL_EXTENSIONS_REGEXP,\n JS_AND_TS_EXTENSIONS,\n JS_AND_TS_EXTENSIONS_GLOB_PART,\n TS_EXTENSIONS_GLOB_PART,\n} from '../constants';\nimport a11yRules from '../rules/a11y';\nimport eslintRules from '../rules/eslint';\nimport commentsRules from '../rules/eslint-comments';\nimport importRules from '../rules/import';\nimport promiseRules from '../rules/promise';\nimport reactRules from '../rules/react';\nimport reactHooksRules from '../rules/react-hooks';\nimport simpleImportSortRules from '../rules/simple-import-sort';\nimport stylisticRules from '../rules/stylistic';\nimport testingLibraryRules from '../rules/testing-library';\nimport typescriptRules from '../rules/typescript';\nimport unicornRules from '../rules/unicorn';\nimport vitestRules from '../rules/vitest';\n\nconst config: eslint.Linter.Config = {\n parserOptions: {\n ecmaVersion: 'latest',\n sourceType: 'module',\n ecmaFeatures: {\n jsx: true,\n },\n },\n plugins: [\n '@stylistic',\n 'eslint-comments',\n 'import',\n 'jsx-a11y',\n 'promise',\n 'react',\n 'react-hooks',\n 'simple-import-sort',\n 'unicorn',\n ],\n env: {\n browser: true,\n es2023: true,\n serviceworker: true,\n 'shared-node-browser': true,\n worker: true,\n },\n settings: {\n 'import/ignore': [\n 'node_modules',\n '\\\\.json$',\n ASSET_EXTENSIONS_REGEXP.source,\n CSS_EXTENSIONS_REGEXP.source,\n GRAPHQL_EXTENSIONS_REGEXP.source,\n ],\n react: {\n version: 'detect',\n },\n propWrapperFunctions: ['forbidExtraProps', 'exact', 'Object.freeze'],\n 'jsx-a11y': {\n polymorphicPropName: 'as',\n components: {\n Button: 'button',\n },\n },\n },\n\n rules: {\n ...eslintRules,\n ...stylisticRules,\n ...commentsRules,\n ...promiseRules,\n ...importRules,\n ...simpleImportSortRules,\n ...reactRules,\n ...reactHooksRules,\n ...a11yRules,\n ...unicornRules,\n },\n overrides: [\n {\n files: [`*.test.${JS_AND_TS_EXTENSIONS_GLOB_PART}`],\n plugins: ['vitest', 'testing-library'],\n settings: {\n 'testing-library/custom-queries': 'off',\n 'testing-library/custom-renders': 'off',\n 'testing-library/utils-module': 'off',\n },\n globals: {\n jsdom: 'readonly',\n },\n env: {\n node: true,\n },\n rules: {\n ...vitestRules,\n ...testingLibraryRules,\n\n // override ESLint rules\n 'max-classes-per-file': 'off', // enforce a maximum number of classes per file\n\n // override eslint-plugin-node rules\n 'node/no-sync': 'off', // disallow synchronous methods\n },\n },\n {\n files: [`*.${TS_EXTENSIONS_GLOB_PART}`],\n plugins: ['@typescript-eslint'],\n parser: '@typescript-eslint/parser',\n parserOptions: {\n EXPERIMENTAL_useProjectService: true,\n },\n settings: {\n node: {\n tryExtensions: JS_AND_TS_EXTENSIONS,\n },\n 'import/resolver': {\n typescript: {},\n },\n 'import/parsers': {\n '@typescript-eslint/parser': ['.ts', '.tsx', '.mts', '.cts'],\n },\n },\n rules: {\n ...typescriptRules,\n\n // override eslint-plugin-import rules\n 'import/no-extraneous-dependencies': [\n 'error',\n {\n devDependencies: [\n `**/*.test.${JS_AND_TS_EXTENSIONS_GLOB_PART}`,\n `tests/**/*.${JS_AND_TS_EXTENSIONS_GLOB_PART}`,\n `tools/**/*.${JS_AND_TS_EXTENSIONS_GLOB_PART}`,\n `./*.${JS_AND_TS_EXTENSIONS_GLOB_PART}`,\n ],\n optionalDependencies: false,\n },\n ],\n },\n },\n {\n files: [`*.test.${TS_EXTENSIONS_GLOB_PART}`],\n rules: {\n // override @typescript-eslint/eslint-plugin rules\n '@typescript-eslint/ban-ts-comment': 'off', // bans // @ts-<directive> comments from being used\n '@typescript-eslint/no-floating-promises': 'off', // requires Promise-like values to be handled appropriately\n },\n },\n ],\n};\n\nexport = config;\n"],
5
+ "mappings": "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",
6
+ "names": ["eslintRules", "stylisticRules", "commentsRules", "promiseRules", "importRules", "simpleImportSortRules", "reactRules", "reactHooksRules", "a11yRules", "unicornRules", "vitestRules", "testingLibraryRules", "typescriptRules"]
7
+ }
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from === "object" || typeof from === "function") {
10
+ for (let key of __getOwnPropNames(from))
11
+ if (!__hasOwnProp.call(to, key) && key !== except)
12
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
13
+ }
14
+ return to;
15
+ };
16
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
17
+ // If the importer is in node compatibility mode or this is not an ESM
18
+ // file that has been converted to a CommonJS file using a Babel-
19
+ // compatible transform (i.e. "__esModule" has not been set), then set
20
+ // "default" to the CommonJS "module.exports" for node compatibility.
21
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
+ mod
23
+ ));
24
+ var import_node = __toESM(require("../rules/node"));
25
+ const config = {
26
+ plugins: ["node"],
27
+ env: {
28
+ browser: false,
29
+ node: true
30
+ },
31
+ settings: {
32
+ node: {
33
+ tryExtensions: [".js", ".jsx", ".json", ".mjs", ".cjs"]
34
+ },
35
+ convertPath: {
36
+ "src/**/*.ts": ["^src/(.+?)\\.ts$", "lib/$1.js"],
37
+ "src/**/*.tsx": ["^src/(.+?)\\.tsx$", "lib/$1.js"],
38
+ "src/**/*.mts": ["^src/(.+?)\\.ts$", "esm/$1.js"],
39
+ "src/**/*.cts": ["^src/(.+?)\\.tsx$", "lib/$1.js"]
40
+ }
41
+ },
42
+ rules: {
43
+ ...import_node.default
44
+ }
45
+ };
46
+ module.exports = config;
47
+ //# sourceMappingURL=nodejs.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../source/presets/nodejs.ts"],
4
+ "sourcesContent": ["import type eslint from 'eslint';\n\nimport nodeRules from '../rules/node';\n\nconst config: eslint.Linter.Config = {\n plugins: ['node'],\n env: {\n browser: false,\n node: true,\n },\n settings: {\n node: {\n tryExtensions: ['.js', '.jsx', '.json', '.mjs', '.cjs'],\n },\n convertPath: {\n 'src/**/*.ts': ['^src/(.+?)\\\\.ts$', 'lib/$1.js'],\n 'src/**/*.tsx': ['^src/(.+?)\\\\.tsx$', 'lib/$1.js'],\n 'src/**/*.mts': ['^src/(.+?)\\\\.ts$', 'esm/$1.js'],\n 'src/**/*.cts': ['^src/(.+?)\\\\.tsx$', 'lib/$1.js'],\n },\n },\n rules: {\n ...nodeRules,\n },\n};\n\nexport = config;\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAEA,kBAAsB;AAEtB,MAAM,SAA+B;AAAA,EACnC,SAAS,CAAC,MAAM;AAAA,EAChB,KAAK;AAAA,IACH,SAAS;AAAA,IACT,MAAM;AAAA,EACR;AAAA,EACA,UAAU;AAAA,IACR,MAAM;AAAA,MACJ,eAAe,CAAC,OAAO,QAAQ,SAAS,QAAQ,MAAM;AAAA,IACxD;AAAA,IACA,aAAa;AAAA,MACX,eAAe,CAAC,oBAAoB,WAAW;AAAA,MAC/C,gBAAgB,CAAC,qBAAqB,WAAW;AAAA,MACjD,gBAAgB,CAAC,oBAAoB,WAAW;AAAA,MAChD,gBAAgB,CAAC,qBAAqB,WAAW;AAAA,IACnD;AAAA,EACF;AAAA,EACA,OAAO;AAAA,IACL,GAAG,YAAAA;AAAA,EACL;AACF;AAEA,iBAAS;",
6
+ "names": ["nodeRules"]
7
+ }
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from === "object" || typeof from === "function") {
10
+ for (let key of __getOwnPropNames(from))
11
+ if (!__hasOwnProp.call(to, key) && key !== except)
12
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
13
+ }
14
+ return to;
15
+ };
16
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
17
+ // If the importer is in node compatibility mode or this is not an ESM
18
+ // file that has been converted to a CommonJS file using a Babel-
19
+ // compatible transform (i.e. "__esModule" has not been set), then set
20
+ // "default" to the CommonJS "module.exports" for node compatibility.
21
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
+ mod
23
+ ));
24
+ var import_prettier = __toESM(require("../rules/prettier"));
25
+ const config = {
26
+ extends: ["eslint-config-prettier"],
27
+ plugins: ["eslint-plugin-prettier"],
28
+ rules: {
29
+ ...import_prettier.default
30
+ }
31
+ };
32
+ module.exports = config;
33
+ //# sourceMappingURL=prettier.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../source/presets/prettier.ts"],
4
+ "sourcesContent": ["import type eslint from 'eslint';\n\nimport prettierRules from '../rules/prettier';\n\nconst config: eslint.Linter.Config = {\n extends: ['eslint-config-prettier'],\n plugins: ['eslint-plugin-prettier'],\n rules: {\n ...prettierRules,\n },\n};\n\nexport = config;\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAEA,sBAA0B;AAE1B,MAAM,SAA+B;AAAA,EACnC,SAAS,CAAC,wBAAwB;AAAA,EAClC,SAAS,CAAC,wBAAwB;AAAA,EAClC,OAAO;AAAA,IACL,GAAG,gBAAAA;AAAA,EACL;AACF;AAEA,iBAAS;",
6
+ "names": ["prettierRules"]
7
+ }
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var graphql_exports = {};
20
+ __export(graphql_exports, {
21
+ interfaceVersion: () => interfaceVersion,
22
+ resolve: () => resolve
23
+ });
24
+ module.exports = __toCommonJS(graphql_exports);
25
+ var import_constants = require("../constants");
26
+ const interfaceVersion = 2;
27
+ function resolve(source) {
28
+ if (import_constants.GRAPHQL_EXTENSIONS_REGEXP.test(source)) {
29
+ return { found: true, path: null };
30
+ }
31
+ return { found: false };
32
+ }
33
+ // Annotate the CommonJS export names for ESM import in node:
34
+ 0 && (module.exports = {
35
+ interfaceVersion,
36
+ resolve
37
+ });
38
+ //# sourceMappingURL=graphql.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../source/resolvers/graphql.ts"],
4
+ "sourcesContent": ["import {GRAPHQL_EXTENSIONS_REGEXP} from '../constants';\n\nexport const interfaceVersion = 2;\n\nexport function resolve(source: string): {found: boolean; path?: unknown} {\n if (GRAPHQL_EXTENSIONS_REGEXP.test(source)) {\n return {found: true, path: null};\n }\n\n return {found: false};\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAwC;AAEjC,MAAM,mBAAmB;AAEzB,SAAS,QAAQ,QAAkD;AACxE,MAAI,2CAA0B,KAAK,MAAM,GAAG;AAC1C,WAAO,EAAC,OAAO,MAAM,MAAM,KAAI;AAAA,EACjC;AAEA,SAAO,EAAC,OAAO,MAAK;AACtB;",
6
+ "names": []
7
+ }
@@ -0,0 +1,106 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var a11y_exports = {};
20
+ __export(a11y_exports, {
21
+ default: () => a11y_default
22
+ });
23
+ module.exports = __toCommonJS(a11y_exports);
24
+ const config = {
25
+ // eslint-plugin-jsx-a11y rules
26
+ "jsx-a11y/alt-text": "warn",
27
+ // enforce all elements that require alternative text have meaningful information to relay back to end user
28
+ "jsx-a11y/anchor-ambiguous-text": "off",
29
+ // enforce <a> text to not exactly match "click here", "here", "link", or "a link"
30
+ "jsx-a11y/anchor-has-content": ["warn", { components: ["Link"] }],
31
+ // enforce all anchors to contain accessible content
32
+ "jsx-a11y/anchor-is-valid": [
33
+ "error",
34
+ {
35
+ components: ["Link"],
36
+ specialLink: ["hrefLeft", "hrefRight", "to"]
37
+ }
38
+ ],
39
+ // enforce all anchors are valid, navigable elements
40
+ "jsx-a11y/aria-activedescendant-has-tabindex": "warn",
41
+ // enforce elements with aria-active descendant are tab-able
42
+ "jsx-a11y/aria-props": "error",
43
+ // enforce all aria-* props are valid
44
+ "jsx-a11y/aria-proptypes": "error",
45
+ // enforce ARIA state and property values are valid
46
+ "jsx-a11y/aria-role": ["error", { ignoreNonDOM: false }],
47
+ // enforce that elements with ARIA roles must use a valid, non-abstract ARIA role
48
+ "jsx-a11y/aria-unsupported-elements": "error",
49
+ // enforce that elements that do not support ARIA roles, states, and properties do not have those attributes
50
+ "jsx-a11y/autocomplete-valid": "warn",
51
+ // enforce that autocomplete attributes are used correctly.
52
+ "jsx-a11y/click-events-have-key-events": "warn",
53
+ // enforce a clickable non-interactive element has at least one keyboard event listener
54
+ "jsx-a11y/control-has-associated-label": "warn",
55
+ // enforce that a control (an interactive element) has a text label
56
+ "jsx-a11y/heading-has-content": ["warn", { components: ["Typography"] }],
57
+ // enforce heading (h1, h2, etc) elements contain accessible content
58
+ "jsx-a11y/html-has-lang": "warn",
59
+ // enforce <html> element has lang prop
60
+ "jsx-a11y/iframe-has-title": "warn",
61
+ // enforce iframe elements have a title attribute
62
+ "jsx-a11y/img-redundant-alt": "warn",
63
+ // enforce <img> alt prop does not contain the word "image", "picture", or "photo"
64
+ "jsx-a11y/interactive-supports-focus": "warn",
65
+ // enforce that elements with interactive handlers like onClick must be focusable
66
+ "jsx-a11y/label-has-associated-control": "warn",
67
+ // enforce that a label tag has a text label and an associated control
68
+ "jsx-a11y/lang": "error",
69
+ // enforce lang attribute has a valid value
70
+ "jsx-a11y/media-has-caption": "warn",
71
+ // enforces that <audio> and <video> elements must have a <track> for captions
72
+ "jsx-a11y/mouse-events-have-key-events": "warn",
73
+ // enforce that onMouseOver/onMouseOut are accompanied by onFocus/onBlur for keyboard-only users
74
+ "jsx-a11y/no-access-key": "warn",
75
+ // enforce that the accessKey prop is not used on any element to avoid complications with keyboard commands used by a screen reader
76
+ "jsx-a11y/no-aria-hidden-on-focusable": "warn",
77
+ // disallow aria-hidden="true" from being set on focusable elements
78
+ "jsx-a11y/no-autofocus": "off",
79
+ // enforce autoFocus prop is not used
80
+ "jsx-a11y/no-distracting-elements": "error",
81
+ // enforce distracting elements are not used
82
+ "jsx-a11y/no-interactive-element-to-noninteractive-role": "warn",
83
+ // interactive elements should not be assigned non-interactive roles
84
+ "jsx-a11y/no-noninteractive-element-interactions": "warn",
85
+ // non-interactive elements should not be assigned mouse or keyboard event listeners
86
+ "jsx-a11y/no-noninteractive-element-to-interactive-role": "warn",
87
+ // Non-interactive elements should not be assigned interactive roles
88
+ "jsx-a11y/no-noninteractive-tabindex": "error",
89
+ // tabIndex should only be declared on interactive elements
90
+ "jsx-a11y/no-redundant-roles": "error",
91
+ // enforce explicit role property is not the same as implicit/default role property on element
92
+ "jsx-a11y/no-static-element-interactions": "warn",
93
+ // enforce that non-interactive, visible elements (such as <div>) that have click handlers use the role attribute
94
+ "jsx-a11y/prefer-tag-over-role": "warn",
95
+ // enforces using semantic DOM elements over the ARIA role property
96
+ "jsx-a11y/role-has-required-aria-props": "error",
97
+ // enforce that elements with ARIA roles must have all required attributes for that role
98
+ "jsx-a11y/role-supports-aria-props": "error",
99
+ // enforce that elements with explicit or implicit roles defined contain only aria-* properties supported by that role
100
+ "jsx-a11y/scope": "error",
101
+ // enforce scope prop is only used on <th> elements
102
+ "jsx-a11y/tabindex-no-positive": "error"
103
+ // enforce tabIndex value is not greater than zero
104
+ };
105
+ var a11y_default = config;
106
+ //# sourceMappingURL=a11y.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../source/rules/a11y.ts"],
4
+ "sourcesContent": ["import type eslint from 'eslint';\n\nconst config: eslint.Linter.Config['rules'] = {\n // eslint-plugin-jsx-a11y rules\n 'jsx-a11y/alt-text': 'warn', // enforce all elements that require alternative text have meaningful information to relay back to end user\n 'jsx-a11y/anchor-ambiguous-text': 'off', // enforce <a> text to not exactly match \"click here\", \"here\", \"link\", or \"a link\"\n 'jsx-a11y/anchor-has-content': ['warn', {components: ['Link']}], // enforce all anchors to contain accessible content\n 'jsx-a11y/anchor-is-valid': [\n 'error',\n {\n components: ['Link'],\n specialLink: ['hrefLeft', 'hrefRight', 'to'],\n },\n ], // enforce all anchors are valid, navigable elements\n 'jsx-a11y/aria-activedescendant-has-tabindex': 'warn', // enforce elements with aria-active descendant are tab-able\n 'jsx-a11y/aria-props': 'error', // enforce all aria-* props are valid\n 'jsx-a11y/aria-proptypes': 'error', // enforce ARIA state and property values are valid\n 'jsx-a11y/aria-role': ['error', {ignoreNonDOM: false}], // enforce that elements with ARIA roles must use a valid, non-abstract ARIA role\n 'jsx-a11y/aria-unsupported-elements': 'error', // enforce that elements that do not support ARIA roles, states, and properties do not have those attributes\n 'jsx-a11y/autocomplete-valid': 'warn', // enforce that autocomplete attributes are used correctly.\n 'jsx-a11y/click-events-have-key-events': 'warn', // enforce a clickable non-interactive element has at least one keyboard event listener\n 'jsx-a11y/control-has-associated-label': 'warn', // enforce that a control (an interactive element) has a text label\n 'jsx-a11y/heading-has-content': ['warn', {components: ['Typography']}], // enforce heading (h1, h2, etc) elements contain accessible content\n 'jsx-a11y/html-has-lang': 'warn', // enforce <html> element has lang prop\n 'jsx-a11y/iframe-has-title': 'warn', // enforce iframe elements have a title attribute\n 'jsx-a11y/img-redundant-alt': 'warn', // enforce <img> alt prop does not contain the word \"image\", \"picture\", or \"photo\"\n 'jsx-a11y/interactive-supports-focus': 'warn', // enforce that elements with interactive handlers like onClick must be focusable\n 'jsx-a11y/label-has-associated-control': 'warn', // enforce that a label tag has a text label and an associated control\n 'jsx-a11y/lang': 'error', // enforce lang attribute has a valid value\n 'jsx-a11y/media-has-caption': 'warn', // enforces that <audio> and <video> elements must have a <track> for captions\n 'jsx-a11y/mouse-events-have-key-events': 'warn', // enforce that onMouseOver/onMouseOut are accompanied by onFocus/onBlur for keyboard-only users\n 'jsx-a11y/no-access-key': 'warn', // enforce that the accessKey prop is not used on any element to avoid complications with keyboard commands used by a screen reader\n 'jsx-a11y/no-aria-hidden-on-focusable': 'warn', // disallow aria-hidden=\"true\" from being set on focusable elements\n 'jsx-a11y/no-autofocus': 'off', // enforce autoFocus prop is not used\n 'jsx-a11y/no-distracting-elements': 'error', // enforce distracting elements are not used\n 'jsx-a11y/no-interactive-element-to-noninteractive-role': 'warn', // interactive elements should not be assigned non-interactive roles\n 'jsx-a11y/no-noninteractive-element-interactions': 'warn', // non-interactive elements should not be assigned mouse or keyboard event listeners\n 'jsx-a11y/no-noninteractive-element-to-interactive-role': 'warn', // Non-interactive elements should not be assigned interactive roles\n 'jsx-a11y/no-noninteractive-tabindex': 'error', // tabIndex should only be declared on interactive elements\n 'jsx-a11y/no-redundant-roles': 'error', // enforce explicit role property is not the same as implicit/default role property on element\n 'jsx-a11y/no-static-element-interactions': 'warn', // enforce that non-interactive, visible elements (such as <div>) that have click handlers use the role attribute\n 'jsx-a11y/prefer-tag-over-role': 'warn', // enforces using semantic DOM elements over the ARIA role property\n 'jsx-a11y/role-has-required-aria-props': 'error', // enforce that elements with ARIA roles must have all required attributes for that role\n 'jsx-a11y/role-supports-aria-props': 'error', // enforce that elements with explicit or implicit roles defined contain only aria-* properties supported by that role\n 'jsx-a11y/scope': 'error', // enforce scope prop is only used on <th> elements\n 'jsx-a11y/tabindex-no-positive': 'error', // enforce tabIndex value is not greater than zero\n};\n\nexport default config;\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,MAAM,SAAwC;AAAA;AAAA,EAE5C,qBAAqB;AAAA;AAAA,EACrB,kCAAkC;AAAA;AAAA,EAClC,+BAA+B,CAAC,QAAQ,EAAC,YAAY,CAAC,MAAM,EAAC,CAAC;AAAA;AAAA,EAC9D,4BAA4B;AAAA,IAC1B;AAAA,IACA;AAAA,MACE,YAAY,CAAC,MAAM;AAAA,MACnB,aAAa,CAAC,YAAY,aAAa,IAAI;AAAA,IAC7C;AAAA,EACF;AAAA;AAAA,EACA,+CAA+C;AAAA;AAAA,EAC/C,uBAAuB;AAAA;AAAA,EACvB,2BAA2B;AAAA;AAAA,EAC3B,sBAAsB,CAAC,SAAS,EAAC,cAAc,MAAK,CAAC;AAAA;AAAA,EACrD,sCAAsC;AAAA;AAAA,EACtC,+BAA+B;AAAA;AAAA,EAC/B,yCAAyC;AAAA;AAAA,EACzC,yCAAyC;AAAA;AAAA,EACzC,gCAAgC,CAAC,QAAQ,EAAC,YAAY,CAAC,YAAY,EAAC,CAAC;AAAA;AAAA,EACrE,0BAA0B;AAAA;AAAA,EAC1B,6BAA6B;AAAA;AAAA,EAC7B,8BAA8B;AAAA;AAAA,EAC9B,uCAAuC;AAAA;AAAA,EACvC,yCAAyC;AAAA;AAAA,EACzC,iBAAiB;AAAA;AAAA,EACjB,8BAA8B;AAAA;AAAA,EAC9B,yCAAyC;AAAA;AAAA,EACzC,0BAA0B;AAAA;AAAA,EAC1B,wCAAwC;AAAA;AAAA,EACxC,yBAAyB;AAAA;AAAA,EACzB,oCAAoC;AAAA;AAAA,EACpC,0DAA0D;AAAA;AAAA,EAC1D,mDAAmD;AAAA;AAAA,EACnD,0DAA0D;AAAA;AAAA,EAC1D,uCAAuC;AAAA;AAAA,EACvC,+BAA+B;AAAA;AAAA,EAC/B,2CAA2C;AAAA;AAAA,EAC3C,iCAAiC;AAAA;AAAA,EACjC,yCAAyC;AAAA;AAAA,EACzC,qCAAqC;AAAA;AAAA,EACrC,kBAAkB;AAAA;AAAA,EAClB,iCAAiC;AAAA;AACnC;AAEA,IAAO,eAAQ;",
6
+ "names": []
7
+ }