@anolilab/eslint-config 14.0.8 → 14.0.10
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/CHANGELOG.md +15 -0
- package/README.md +39 -7
- package/bin/generate-eslint-cofig.js +1 -0
- package/dist/config/plugins/html.js +1 -1
- package/dist/config/plugins/html.js.map +1 -1
- package/dist/config/plugins/import.js +1 -1
- package/dist/config/plugins/import.js.map +1 -1
- package/dist/config/plugins/jsdoc.js +1 -1
- package/dist/config/plugins/jsdoc.js.map +1 -1
- package/dist/config/plugins/jsonc.js +1 -1
- package/dist/config/plugins/jsonc.js.map +1 -1
- package/dist/config/plugins/react.js +1 -1
- package/dist/config/plugins/react.js.map +1 -1
- package/dist/config/plugins/sonarjs.js +1 -1
- package/dist/config/plugins/sonarjs.js.map +1 -1
- package/dist/config/plugins/toml.js +1 -1
- package/dist/config/plugins/toml.js.map +1 -1
- package/dist/config/plugins/unicorn.js +2 -6
- package/dist/config/plugins/unicorn.js.map +1 -1
- package/dist/config/plugins/yml.js +1 -1
- package/dist/config/plugins/yml.js.map +1 -1
- package/dist/index.js +6 -7
- package/dist/index.js.map +1 -1
- package/dist/postinstall.js +8 -8
- package/dist/postinstall.js.map +1 -1
- package/package.json +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
## @anolilab/eslint-config [14.0.10](https://github.com/anolilab/javascript-style-guide/compare/@anolilab/eslint-config@14.0.9...@anolilab/eslint-config@14.0.10) (2023-09-26)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* moved @jsenv/eslint-import-resolver from dev to require dependency ([981eb4d](https://github.com/anolilab/javascript-style-guide/commit/981eb4d3e4c3b784f2567e7887a5f1d80b7cf0d2))
|
|
7
|
+
* Updated file patterns in eslint configs to apply to subdirectories ([13ec6fb](https://github.com/anolilab/javascript-style-guide/commit/13ec6fbdc22717204562aa945bf6bda483d2e642))
|
|
8
|
+
|
|
9
|
+
## @anolilab/eslint-config [14.0.9](https://github.com/anolilab/javascript-style-guide/compare/@anolilab/eslint-config@14.0.8...@anolilab/eslint-config@14.0.9) (2023-09-26)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
* A new dependency "@jsenv/eslint-import-resolver" was added to tackle the issue of "import/no-useless-path-segments", "import/no-unused-modules" and some other import rules not working correctly. ([8b9b033](https://github.com/anolilab/javascript-style-guide/commit/8b9b03333363413b214b5f5d01b6c5ebd7dd08b3))
|
|
15
|
+
|
|
1
16
|
## @anolilab/eslint-config [14.0.8](https://github.com/anolilab/javascript-style-guide/compare/@anolilab/eslint-config@14.0.7...@anolilab/eslint-config@14.0.8) (2023-09-26)
|
|
2
17
|
|
|
3
18
|
|
package/README.md
CHANGED
|
@@ -52,15 +52,15 @@ To install this config, run the following command.
|
|
|
52
52
|
> Note: `eslint-plugin-import@npm:eslint-plugin-i` is needed to use the correct package.
|
|
53
53
|
|
|
54
54
|
```bash
|
|
55
|
-
npm install --save-dev eslint @anolilab/eslint-config eslint-plugin-import@npm:eslint-plugin-i@latest
|
|
55
|
+
npm install --save-dev eslint @anolilab/eslint-config eslint-plugin-import@npm:eslint-plugin-i@latest @babel/core
|
|
56
56
|
```
|
|
57
57
|
|
|
58
58
|
```sh
|
|
59
|
-
pnpm add -D eslint @anolilab/eslint-config eslint-plugin-import@npm:eslint-plugin-i@latest
|
|
59
|
+
pnpm add -D eslint @anolilab/eslint-config eslint-plugin-import@npm:eslint-plugin-i@latest @babel/core
|
|
60
60
|
```
|
|
61
61
|
|
|
62
62
|
```sh
|
|
63
|
-
yarn add -D eslint @anolilab/eslint-config eslint-plugin-import@npm:eslint-plugin-i@latest
|
|
63
|
+
yarn add -D eslint @anolilab/eslint-config eslint-plugin-import@npm:eslint-plugin-i@latest @babel/core
|
|
64
64
|
```
|
|
65
65
|
|
|
66
66
|
## Usage
|
|
@@ -112,7 +112,7 @@ For more advanced use cases see the example configurations for Node, TypeScript,
|
|
|
112
112
|
### TypeScript
|
|
113
113
|
|
|
114
114
|
```bash
|
|
115
|
-
npm install --save-dev
|
|
115
|
+
npm install --save-dev typescript
|
|
116
116
|
```
|
|
117
117
|
|
|
118
118
|
Please extend the `.eslintrc.js` file with the correct `tsconfig.js` path if you have a custom path.
|
|
@@ -167,7 +167,11 @@ module.exports = defineConfig({
|
|
|
167
167
|
You need to have "react" and "react-dom" installed.
|
|
168
168
|
|
|
169
169
|
```bash
|
|
170
|
-
|
|
170
|
+
npm install --save-dev eslint-plugin-react eslint-plugin-react-hooks
|
|
171
|
+
|
|
172
|
+
yarn add -D eslint-plugin-react eslint-plugin-react-hooks
|
|
173
|
+
|
|
174
|
+
pnpm add -D eslint-plugin-react eslint-plugin-react-hooks
|
|
171
175
|
```
|
|
172
176
|
|
|
173
177
|
Or for the use of `TypeScript` in react install "typescript" as a dev dependency.
|
|
@@ -182,10 +186,38 @@ module.exports = {
|
|
|
182
186
|
};
|
|
183
187
|
```
|
|
184
188
|
|
|
189
|
+
Or for the use of `.jsx` files install "@babel/plugin-syntax-jsx" as a dev dependency.
|
|
190
|
+
|
|
191
|
+
```bash
|
|
192
|
+
npm install --save-dev babel @babel/plugin-syntax-jsx
|
|
193
|
+
|
|
194
|
+
yarn add -D babel @babel/plugin-syntax-jsx
|
|
195
|
+
|
|
196
|
+
pnpm add -D babel @babel/plugin-syntax-jsx
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
In your `babel.config.js` file add the plugin.
|
|
200
|
+
|
|
201
|
+
```js
|
|
202
|
+
const babelPluginSyntaxJSX = require("@babel/plugin-syntax-jsx");
|
|
203
|
+
|
|
204
|
+
module.exports = {
|
|
205
|
+
plugins: [
|
|
206
|
+
[
|
|
207
|
+
babelPluginSyntaxJSX,
|
|
208
|
+
{
|
|
209
|
+
pragma: "React.createElement",
|
|
210
|
+
pragmaFrag: "React.Fragment",
|
|
211
|
+
},
|
|
212
|
+
],
|
|
213
|
+
],
|
|
214
|
+
};
|
|
215
|
+
```
|
|
216
|
+
|
|
185
217
|
### MDX
|
|
186
218
|
|
|
187
219
|
```bash
|
|
188
|
-
npm install --save-dev eslint eslint-plugin-mdx
|
|
220
|
+
npm install --save-dev eslint eslint-plugin-mdx
|
|
189
221
|
```
|
|
190
222
|
|
|
191
223
|
For more information about `missing` or `optional` to install rules see the `eslint` console output.
|
|
@@ -359,7 +391,7 @@ Of course, we also provide a recommended Prettier [configuration](../prettier-co
|
|
|
359
391
|
If you are using experimental features such as class fields with JavaScript files you should install `@babel/eslint-parser`.
|
|
360
392
|
|
|
361
393
|
```bash
|
|
362
|
-
npm install --save-dev @babel/core
|
|
394
|
+
npm install --save-dev @babel/core
|
|
363
395
|
```
|
|
364
396
|
|
|
365
397
|
## Plugins
|
|
@@ -5,7 +5,7 @@ require('../../chunk-WW4PDMXQ.js');
|
|
|
5
5
|
require('../../chunk-MFE6DF6Y.js');
|
|
6
6
|
var packageJsonUtils = require('@anolilab/package-json-utils');
|
|
7
7
|
|
|
8
|
-
!global.hasAnolilabEsLintConfigPrettier&&(packageJsonUtils.hasDependency("prettier")||packageJsonUtils.hasDevDependency("prettier"))&&(global.hasAnolilabEsLintConfigPrettier=!0);global.hasAnolilabEsLintConfigPrettier&&(global.anolilabEslintConfigHtmlPrettierRules={"@html-eslint/element-newline":"off","@html-eslint/indent":"off","@html-eslint/no-extra-spacing-attrs":"off","@html-eslint/quotes":"off"},global.anolilabEslintConfigHtmlPrettierSettings={"html/report-bad-indent":"off"});var e={};global.hasAnolilabEsLintConfigPrettier||(e={"html/indent":`+${chunkR26SPKXH_js.a}`});var
|
|
8
|
+
!global.hasAnolilabEsLintConfigPrettier&&(packageJsonUtils.hasDependency("prettier")||packageJsonUtils.hasDevDependency("prettier"))&&(global.hasAnolilabEsLintConfigPrettier=!0);global.hasAnolilabEsLintConfigPrettier&&(global.anolilabEslintConfigHtmlPrettierRules={"@html-eslint/element-newline":"off","@html-eslint/indent":"off","@html-eslint/no-extra-spacing-attrs":"off","@html-eslint/quotes":"off"},global.anolilabEslintConfigHtmlPrettierSettings={"html/report-bad-indent":"off"});var e={};global.hasAnolilabEsLintConfigPrettier||(e={"html/indent":`+${chunkR26SPKXH_js.a}`});var i={overrides:[{extends:["plugin:@html-eslint/recommended"],files:["**/*.erb","**/*.handlebars","**/*.hbs","**/*.htm","**/*.html","**/*.mustache","**/*.nunjucks","**/*.php","**/*.tag","**/*.twig","**/*.we"],globals:{sourceCode:!0},env:{browser:!0,node:!1},parser:"@html-eslint/parser",plugins:["html","@html-eslint"],rules:{"@html-eslint/indent":["error",chunkR26SPKXH_js.a],"capitalized-comments":"off","spaced-comment":"off",...global.anolilabEslintConfigHtmlPrettierRules},settings:{"html/report-bad-indent":"error",...e,...global.anolilabEslintConfigHtmlPrettierSettings}}]},s=i;
|
|
9
9
|
|
|
10
10
|
module.exports = s;
|
|
11
11
|
//# sourceMappingURL=out.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/config/plugins/html.ts"],"names":["hasDependency","hasDevDependency","settings","indent_default","config","html_default"],"mappings":"4GAAA,OAAS,iBAAAA,EAAe,oBAAAC,MAAwB,+BAK5C,CAAC,OAAO,kCAAoCD,EAAc,UAAU,GAAKC,EAAiB,UAAU,KACpG,OAAO,gCAAkC,IAGzC,OAAO,kCACP,OAAO,sCAAwC,CAC3C,+BAAgC,MAChC,sBAAuB,MACvB,sCAAuC,MACvC,sBAAuB,KAC3B,EAEA,OAAO,yCAA2C,CAC9C,yBAA0B,KAC9B,GAGJ,IAAIC,EAAsC,CAAC,EAEtC,OAAO,kCACRA,EAAW,CACP,cAAe,IAAIC,CAAM,EAC7B,GAGJ,IAAMC,EAAwB,CAC1B,UAAW,CACP,CACI,QAAS,CAAC,iCAAiC,EAC3C,MAAO,
|
|
1
|
+
{"version":3,"sources":["../../../src/config/plugins/html.ts"],"names":["hasDependency","hasDevDependency","settings","indent_default","config","html_default"],"mappings":"4GAAA,OAAS,iBAAAA,EAAe,oBAAAC,MAAwB,+BAK5C,CAAC,OAAO,kCAAoCD,EAAc,UAAU,GAAKC,EAAiB,UAAU,KACpG,OAAO,gCAAkC,IAGzC,OAAO,kCACP,OAAO,sCAAwC,CAC3C,+BAAgC,MAChC,sBAAuB,MACvB,sCAAuC,MACvC,sBAAuB,KAC3B,EAEA,OAAO,yCAA2C,CAC9C,yBAA0B,KAC9B,GAGJ,IAAIC,EAAsC,CAAC,EAEtC,OAAO,kCACRA,EAAW,CACP,cAAe,IAAIC,CAAM,EAC7B,GAGJ,IAAMC,EAAwB,CAC1B,UAAW,CACP,CACI,QAAS,CAAC,iCAAiC,EAC3C,MAAO,CACH,WACA,kBACA,WACA,WACA,YACA,gBACA,gBACA,WACA,WACA,YACA,SACJ,EACA,QAAS,CACL,WAAY,EAChB,EACA,IAAK,CACD,QAAS,GACT,KAAM,EACV,EACA,OAAQ,sBACR,QAAS,CAAC,OAAQ,cAAc,EAChC,MAAO,CACH,sBAAuB,CAAC,QAASD,CAAM,EACvC,uBAAwB,MAExB,iBAAkB,MAElB,GAAG,OAAO,qCACd,EACA,SAAU,CACN,yBAA0B,QAC1B,GAAGD,EACH,GAAG,OAAO,wCACd,CACJ,CACJ,CACJ,EAEOG,EAAQD","sourcesContent":["import { hasDependency, hasDevDependency } from \"@anolilab/package-json-utils\";\nimport type { Linter } from \"eslint\";\n\nimport indent from \"../../utils/indent\";\n\nif (!global.hasAnolilabEsLintConfigPrettier && (hasDependency(\"prettier\") || hasDevDependency(\"prettier\"))) {\n global.hasAnolilabEsLintConfigPrettier = true;\n}\n\nif (global.hasAnolilabEsLintConfigPrettier) {\n global.anolilabEslintConfigHtmlPrettierRules = {\n \"@html-eslint/element-newline\": \"off\",\n \"@html-eslint/indent\": \"off\",\n \"@html-eslint/no-extra-spacing-attrs\": \"off\",\n \"@html-eslint/quotes\": \"off\",\n };\n\n global.anolilabEslintConfigHtmlPrettierSettings = {\n \"html/report-bad-indent\": \"off\",\n };\n}\n\nlet settings: Linter.Config[\"settings\"] = {};\n\nif (!global.hasAnolilabEsLintConfigPrettier) {\n settings = {\n \"html/indent\": `+${indent}`,\n };\n}\n\nconst config: Linter.Config = {\n overrides: [\n {\n extends: [\"plugin:@html-eslint/recommended\"],\n files: [\n \"**/*.erb\",\n \"**/*.handlebars\",\n \"**/*.hbs\",\n \"**/*.htm\",\n \"**/*.html\",\n \"**/*.mustache\",\n \"**/*.nunjucks\",\n \"**/*.php\",\n \"**/*.tag\",\n \"**/*.twig\",\n \"**/*.we\",\n ],\n globals: {\n sourceCode: true,\n },\n env: {\n browser: true,\n node: false,\n },\n parser: \"@html-eslint/parser\",\n plugins: [\"html\", \"@html-eslint\"],\n rules: {\n \"@html-eslint/indent\": [\"error\", indent],\n \"capitalized-comments\": \"off\",\n // @see https://github.com/yeonjuan/html-eslint/issues/67 bug in html-eslint\n \"spaced-comment\": \"off\",\n\n ...global.anolilabEslintConfigHtmlPrettierRules,\n },\n settings: {\n \"html/report-bad-indent\": \"error\",\n ...settings,\n ...global.anolilabEslintConfigHtmlPrettierSettings,\n },\n },\n ],\n};\n\nexport default config;\n"]}
|
|
@@ -5,7 +5,7 @@ var chunkWG6GTAIA_js = require('../../chunk-WG6GTAIA.js');
|
|
|
5
5
|
require('../../chunk-MFE6DF6Y.js');
|
|
6
6
|
var packageJsonUtils = require('@anolilab/package-json-utils');
|
|
7
7
|
|
|
8
|
-
if(global.anolilabEslintImportNoUnusedModulesConfig===void 0&&chunkWW4PDMXQ_js.a.import_ignore_exports){if(!Array.isArray(chunkWW4PDMXQ_js.a.import_ignore_exports))throw new TypeError("import.ignore_exports must be a array");global.anolilabEslintImportNoUnusedModulesConfig=chunkWW4PDMXQ_js.a.import_ignore_exports;}var
|
|
8
|
+
if(global.anolilabEslintImportNoUnusedModulesConfig===void 0&&chunkWW4PDMXQ_js.a.import_ignore_exports){if(!Array.isArray(chunkWW4PDMXQ_js.a.import_ignore_exports))throw new TypeError("import.ignore_exports must be a array");global.anolilabEslintImportNoUnusedModulesConfig=chunkWW4PDMXQ_js.a.import_ignore_exports;}var i=chunkWG6GTAIA_js.b([{config:{env:{es6:!0},parserOptions:{ecmaVersion:6,sourceType:"module"},plugins:["import"],rules:{"import/consistent-type-specifier-style":["error","prefer-top-level"],"import/default":"off","import/dynamic-import-chunkname":["off",{importFunctions:[],webpackChunknameFormat:"[0-9a-zA-Z-_/.]+"}],"import/export":"error","import/exports-last":"error","import/extensions":["error","ignorePackages",packageJsonUtils.packageIsTypeModule?{cjs:"always",js:"always",jsx:"always",mjs:"always",json:"always"}:{cjs:"never",js:"never",jsx:"never",mjs:"never",json:"always"}],"import/first":"error","import/group-exports":"off","import/imports-first":"off","import/max-dependencies":["off",{max:10}],"import/named":"error","import/namespace":"off","import/newline-after-import":"error","import/no-absolute-path":"error","import/no-amd":"error","import/no-anonymous-default-export":["off",{allowAnonymousClass:!1,allowAnonymousFunction:!1,allowArray:!1,allowArrowFunction:!1,allowLiteral:!1,allowObject:!1}],"import/no-commonjs":packageJsonUtils.packageIsTypeModule?["error",{allowPrimitiveModules:!0}]:"off","import/no-cycle":["error",{maxDepth:"\u221E"}],"import/no-default-export":"off","import/no-deprecated":"off","import/no-duplicates":"error","import/no-dynamic-require":"error","import/no-empty-named-blocks":"error","import/no-extraneous-dependencies":["error",{devDependencies:["test/**","tests/**","spec/**","**/fixture/**","**/__mocks__/**","test.{js,jsx}","test-*.{js,jsx}","**/*{.,_}{test,spec}.{js,jsx}","**/jest.config.cjs","**/jest.setup.js","**/vue.config.cjs","**/webpack.config.cjs","**/webpack.config.*.js","**/rollup.config.cjs","**/rollup.config.*.js","**/gulpfile.js","**/gulpfile.*.js","**/Gruntfile{,.js}","**/protractor.conf.js","**/protractor.conf.*.js","**/karma.conf.js","**/.eslintrc.js","**/.eslintrc.cjs","**/.eslintrc.mjs","**/eslint.config.js","**/eslint.config.mjs","**/eslint.config.cjs","**/vite.config.js","**/vite.config.ts","**/vitest.config.js","**/vitest.config.ts","**/__tests__/**/*.?(c|m)[jt]s?(x)","**/?(*.){test,spec}.?(c|m)[jt]s?(x)"],optionalDependencies:!1}],"import/no-internal-modules":["off",{allow:[]}],"import/no-mutable-exports":"error","import/no-named-as-default":"error","import/no-named-as-default-member":"error","import/no-named-default":"error","import/no-named-export":"off","import/no-namespace":"error","import/no-nodejs-modules":"off","import/no-relative-parent-imports":"off","import/no-restricted-paths":"off","import/no-self-import":"error","import/no-unassigned-import":"off","import/no-unresolved":["error",{caseSensitive:!0,commonjs:!0}],"import/no-unused-modules":[packageJsonUtils.packageIsTypeModule?"error":"off",{ignoreExports:global.anolilabEslintImportNoUnusedModulesConfig??[],missingExports:!0,unusedExports:!0}],"import/no-import-module-exports":[packageJsonUtils.packageIsTypeModule?"off":"error",{exceptions:[]}],"import/no-relative-packages":"error","import/no-useless-path-segments":["error",{commonjs:!1,noUselessIndex:!0}],"import/no-webpack-loader-syntax":"error","import/order":"off","import/prefer-default-export":"error","import/unambiguous":"off"},settings:{"import/core-modules":[],"import/extensions":[".js",".cjs",".mjs",".jsx"],"import/ignore":["\\.(coffee|scss|css|less|hbs|svg|json)$"]}},type:"all"},{config:{settings:{"import/resolver":{"@jsenv/eslint-import-resolver":{rootDirectoryUrl:packageJsonUtils.projectPath,packageConditions:["node","import"]}}}},type:"javascript"},{config:{extends:["plugin:import/typescript"],rules:{"import/default":"off","import/export":"off","import/extensions":["error","ignorePackages",{js:"never",jsx:"never",mjs:"never",cjs:"never",ts:"never",tsx:"never",json:"always",svg:"always"}],"import/named":"off","import/no-unresolved":"off"},settings:{"import/extensions":[".js",".mjs",".jsx",".ts",".tsx",".d.ts",".cjs",".cts",".mts"],"import/external-module-folders":["node_modules","node_modules/@types"],"import/parsers":{"@typescript-eslint/parser":[".ts",".cts",".mts",".tsx",".d.ts"]},"import/resolver":{typescript:{alwaysTryTypes:!0,project:packageJsonUtils.fromRoot("tsconfig.json")}}}},type:"typescript"},{config:{rules:{"import/no-duplicates":"off"}},type:"d.ts"}]),a=i;
|
|
9
9
|
|
|
10
10
|
module.exports = a;
|
|
11
11
|
//# sourceMappingURL=out.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/config/plugins/import.ts"],"names":["fromRoot","hasTypescript","packageIsTypeModule","eslint_config_default","config","createConfigs","import_default"],"mappings":"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","sourcesContent":["import { fromRoot, hasTypescript, packageIsTypeModule } from \"@anolilab/package-json-utils\";\nimport type { Linter } from \"eslint\";\n\nimport { createConfigs } from \"../../utils/create-config\";\nimport anolilabEslintConfig from \"../../utils/eslint-config\";\n\nif (global.anolilabEslintImportNoUnusedModulesConfig === undefined && anolilabEslintConfig[\"import_ignore_exports\"]) {\n if (!Array.isArray(anolilabEslintConfig[\"import_ignore_exports\"])) {\n throw new TypeError(\"import.ignore_exports must be a array\");\n }\n\n global.anolilabEslintImportNoUnusedModulesConfig = anolilabEslintConfig[\"import_ignore_exports\"] as string[];\n}\n\nconst config: Linter.Config = createConfigs([\n {\n config: {\n env: {\n es6: true,\n },\n\n parserOptions: {\n ecmaVersion: 6,\n sourceType: \"module\",\n },\n plugins: [\"import\"],\n rules: {\n // enforce a consistent style for type specifiers (inline or top-level)\n // https://github.com/un-es/eslint-plugin-i/blob/d5fc8b670dc8e6903dbb7b0894452f60c03089f5/docs/rules/consistent-type-specifier-style.md\n \"import/consistent-type-specifier-style\": [\"error\", \"prefer-top-level\"],\n\n // ensure named imports coupled with named exports\n // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/default.md#when-not-to-use-it\n \"import/default\": \"off\",\n\n // dynamic imports require a leading comment with a webpackChunkName\n // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/dynamic-import-chunkname.md\n \"import/dynamic-import-chunkname\": [\n \"off\",\n {\n importFunctions: [],\n webpackChunknameFormat: \"[0-9a-zA-Z-_/.]+\",\n },\n ],\n\n // disallow invalid exports, e.g. multiple defaults\n // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/export.md\n \"import/export\": \"error\",\n\n // This rule enforces that all exports are declared at the bottom of the file.\n // https://github.com/import-js/eslint-plugin-import/blob/98acd6afd04dcb6920b81330114e146dc8532ea4/docs/rules/exports-last.md\n \"import/exports-last\": \"error\",\n\n // Ensure consistent use of file extension within the import path\n // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/extensions.md\n \"import/extensions\": [\n \"error\",\n \"ignorePackages\",\n packageIsTypeModule\n ? {\n cjs: \"always\",\n js: \"always\",\n jsx: \"always\",\n mjs: \"always\",\n }\n : {\n cjs: \"never\",\n js: \"never\",\n jsx: \"never\",\n mjs: \"never\",\n },\n ],\n\n // disallow non-import statements appearing before import statements\n // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/first.md\n \"import/first\": \"error\",\n\n // Reports when named exports are not grouped together in a single export declaration\n // or when multiple assignments to CommonJS module.exports or exports object are present\n // in a single file.\n // https://github.com/import-js/eslint-plugin-import/blob/44a038c06487964394b1e15b64f3bd34e5d40cde/docs/rules/group-exports.md\n \"import/group-exports\": \"off\",\n\n // disallow non-import statements appearing before import statements\n // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/imports-first.md\n // deprecated: use `import/first`\n \"import/imports-first\": \"off\",\n\n // Forbid modules to have too many dependencies\n // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/max-dependencies.md\n \"import/max-dependencies\": [\"off\", { max: 10 }],\n\n // disallow require()\n // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/named.md#when-not-to-use-it\n \"import/named\": \"error\",\n\n // disallow AMD require/define\n // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/namespace.md\n \"import/namespace\": \"off\",\n\n // Require a newline after the last import/require in a group\n // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/newline-after-import.md\n \"import/newline-after-import\": \"error\",\n\n // Forbid import of modules using absolute paths\n // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-absolute-path.md\n \"import/no-absolute-path\": \"error\",\n\n // disallow AMD require/define\n // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-amd.md\n \"import/no-amd\": \"error\",\n\n // Reports if a module's default export is unnamed\n // https://github.com/import-js/eslint-plugin-import/blob/d9b712ac7fd1fddc391f7b234827925c160d956f/docs/rules/no-anonymous-default-export.md\n \"import/no-anonymous-default-export\": [\n \"off\",\n {\n allowAnonymousClass: false,\n allowAnonymousFunction: false,\n allowArray: false,\n allowArrowFunction: false,\n allowLiteral: false,\n allowObject: false,\n },\n ],\n\n // disallow require()\n // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-commonjs.md\n \"import/no-commonjs\": packageIsTypeModule ? [\"error\", { allowPrimitiveModules: true }] : \"off\",\n\n // Forbid cyclical dependencies between modules\n // https://medium.com/@steven-lemon182/are-typescript-barrel-files-an-anti-pattern-72a713004250\n \"import/no-cycle\": [\"error\", { maxDepth: \"∞\" }],\n\n // forbid default exports. this is a terrible rule, do not use it.\n // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-default-export.md\n \"import/no-default-export\": \"off\",\n\n // disallow use of jsdoc-marked-deprecated imports\n // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-deprecated.md\n \"import/no-deprecated\": \"off\",\n\n // disallow duplicate imports\n // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-duplicates.md\n \"import/no-duplicates\": \"error\",\n\n // Forbid require() calls with expressions\n // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-dynamic-require.md\n \"import/no-dynamic-require\": \"error\",\n\n // Reports the use of empty named import blocks.\n // https://github.com/un-es/eslint-plugin-i/blob/d5fc8b670dc8e6903dbb7b0894452f60c03089f5/docs/rules/no-empty-named-blocks.md\n \"import/no-empty-named-blocks\": \"error\",\n\n // Forbid the use of extraneous packages\n // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-extraneous-dependencies.md\n // paths are treated both as absolute paths, and relative to process.cwd()\n \"import/no-extraneous-dependencies\": [\n \"error\",\n {\n devDependencies: [\n \"test/**\", // tape, common npm pattern\n \"tests/**\", // also common npm pattern\n \"spec/**\", // mocha, rspec-like pattern\n \"**/fixture/**\", // jest pattern\n \"**/__mocks__/**\", // jest pattern\n \"test.{js,jsx}\", // repos with a single test file\n \"test-*.{js,jsx}\", // repos with multiple top-level test files\n \"**/*{.,_}{test,spec}.{js,jsx}\", // tests where the extension or filename suffix denotes that it is a test\n \"**/jest.config.cjs\", // jest config\n \"**/jest.setup.js\", // jest setup\n \"**/vue.config.cjs\", // vue-cli config\n \"**/webpack.config.cjs\", // webpack config\n \"**/webpack.config.*.js\", // webpack config\n \"**/rollup.config.cjs\", // rollup config\n \"**/rollup.config.*.js\", // rollup config\n \"**/gulpfile.js\", // gulp config\n \"**/gulpfile.*.js\", // gulp config\n \"**/Gruntfile{,.js}\", // grunt config\n \"**/protractor.conf.js\", // protractor config\n \"**/protractor.conf.*.js\", // protractor config\n \"**/karma.conf.js\", // karma config\n \"**/.eslintrc.js\", // eslint config\n \"**/.eslintrc.cjs\", // eslint config\n \"**/.eslintrc.mjs\", // eslint config\n \"**/eslint.config.js\", // eslint flat config\n \"**/eslint.config.mjs\", // eslint flat config\n \"**/eslint.config.cjs\", // eslint flat config\n \"**/vite.config.js\", // vite config\n \"**/vite.config.ts\", // vite config\n \"**/vitest.config.js\", // vitest config\n \"**/vitest.config.ts\", // vitest config\n \"**/__tests__/**/*.?(c|m)[jt]s?(x)\", // vitest config test include\n \"**/?(*.){test,spec}.?(c|m)[jt]s?(x)\", // vitest config test include\n ],\n optionalDependencies: false,\n },\n ],\n\n // prevent importing the submodules of other modules\n // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-internal-modules.md\n \"import/no-internal-modules\": [\n \"off\",\n {\n allow: [],\n },\n ],\n\n // Forbid mutable exports\n // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-mutable-exports.md\n \"import/no-mutable-exports\": \"error\",\n\n // Warn if a module could be mistakenly parsed as a script by a consumer\n // leveraging Unambiguous JavaScript Grammar\n // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/unambiguous.md\n // this should not be enabled until this proposal has at least been *presented* to TC39.\n // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-named-as-default.md\n \"import/no-named-as-default\": \"error\",\n\n // warn on accessing default export property names that are also named exports\n // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-named-as-default-member.md\n \"import/no-named-as-default-member\": \"error\",\n\n // Prevent importing the default as if it were named\n // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-named-default.md\n \"import/no-named-default\": \"error\",\n\n // Prohibit named exports. this is a terrible rule, do not use it.\n // https://github.com/import-js/eslint-plugin-import/blob/1ec80fa35fa1819e2d35a70e68fb6a149fb57c5e/docs/rules/no-named-export.md\n \"import/no-named-export\": \"off\",\n\n // disallow namespace imports\n // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-namespace.md\n \"import/no-namespace\": \"error\",\n\n // No Node.js builtin modules\n // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-nodejs-modules.md\n // TODO: enable?\n \"import/no-nodejs-modules\": \"off\",\n\n // Use this rule to prevent imports to folders in relative parent paths.\n // https://github.com/import-js/eslint-plugin-import/blob/c34f14f67f077acd5a61b3da9c0b0de298d20059/docs/rules/no-relative-parent-imports.md\n \"import/no-relative-parent-imports\": \"off\",\n\n // Restrict which files can be imported in a given folder\n // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-restricted-paths.md\n \"import/no-restricted-paths\": \"off\",\n\n // Forbid a module from importing itself\n // https://github.com/import-js/eslint-plugin-import/blob/44a038c06487964394b1e15b64f3bd34e5d40cde/docs/rules/no-self-import.md\n \"import/no-self-import\": \"error\",\n\n // Forbid a module from importing itself\n // importing for side effects is perfectly acceptable, if you need side effects.\n \"import/no-unassigned-import\": \"off\",\n\n // ensure imports point to files/modules that can be resolved\n // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-unresolved.md\n \"import/no-unresolved\": [\"error\", { caseSensitive: true, commonjs: true }],\n\n // Reports modules without any exports, or with unused exports\n // https://github.com/import-js/eslint-plugin-import/blob/f63dd261809de6883b13b6b5b960e6d7f42a7813/docs/rules/no-unused-modules.md\n \"import/no-unused-modules\": [\n packageIsTypeModule ? \"error\" : \"off\",\n {\n ignoreExports: global.anolilabEslintImportNoUnusedModulesConfig ?? [],\n missingExports: true,\n unusedExports: true,\n },\n ],\n\n // Reports the use of import declarations with CommonJS exports in any module except for the main module.\n // https://github.com/import-js/eslint-plugin-import/blob/1012eb951767279ce3b540a4ec4f29236104bb5b/docs/rules/no-import-module-exports.md\n \"import/no-import-module-exports\": [\n packageIsTypeModule ? \"off\" : \"error\",\n {\n exceptions: [],\n },\n ],\n\n // Use this rule to prevent importing packages through relative paths.\n // https://github.com/import-js/eslint-plugin-import/blob/1012eb951767279ce3b540a4ec4f29236104bb5b/docs/rules/no-relative-packages.md\n \"import/no-relative-packages\": \"error\",\n\n // Ensures that there are no useless path segments\n // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-useless-path-segments.md\n \"import/no-useless-path-segments\": [\"error\", { commonjs: !packageIsTypeModule, noUselessIndex: true }],\n\n // Forbid Webpack loader syntax in imports\n // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-webpack-loader-syntax.md\n \"import/no-webpack-loader-syntax\": \"error\",\n\n // ensure absolute imports are above relative imports and that unassigned imports are ignored\n // https://github.com/import-js/eslint-plugin-import/blob/f63dd261809de6883b13b6b5b960e6d7f42a7813/docs/rules/no-unused-modules.md\n // simple-import-sort does this better\n \"import/order\": \"off\",\n\n // Require modules with a single export to use a default export\n // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/prefer-default-export.md\n \"import/prefer-default-export\": \"error\",\n\n // Warn if a module could be mistakenly parsed as a script by a consumer\n // leveraging Unambiguous JavaScript Grammar\n // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/unambiguous.md\n // this should not be enabled until this proposal has at least been *presented* to TC39.\n // At the moment, it's not a thing.\n \"import/unambiguous\": \"off\",\n },\n settings: {\n \"import/core-modules\": [],\n // https://github.com/un-es/eslint-plugin-i/blob/main/docs/rules/extensions.md\n \"import/extensions\": [\".js\", \".cjs\", \".mjs\", \".jsx\"],\n // Ensure consistent use of file extension within the import path\n \"import/ignore\": [\"\\\\.(coffee|scss|css|less|hbs|svg|json)$\"],\n \"import/resolver\": {\n node: {\n extensions: [\".mjs\", \".js\", \".json\", \".cjs\", \".jsx\"],\n },\n ...(hasTypescript\n ? {\n typescript: {\n alwaysTryTypes: true, // always try to resolve types under `<root>@types` directory even it doesn't contain any source code, like `@types/unist`\n project: fromRoot(\"tsconfig.json\"),\n },\n }\n : {}),\n },\n },\n },\n type: \"all\",\n },\n {\n config: {\n extends: [\"plugin:import/typescript\"],\n rules: {\n // Does not work when the TS definition exports a default const.\n \"import/default\": \"off\",\n\n // Disabled because of https://github.com/import-js/eslint-plugin-import/issues/1590\n \"import/export\": \"off\",\n\n // Disabled as it doesn't work with TypeScript.\n \"import/extensions\": [\n \"error\",\n \"ignorePackages\",\n {\n js: \"never\",\n jsx: \"never\",\n mjs: \"never\",\n ts: \"never\",\n tsx: \"never\",\n },\n ],\n\n // This issue and some others: https://github.com/import-js/eslint-plugin-import/issues/1341\n \"import/named\": \"off\",\n\n // ensure imports point to files/modules that can be resolved\n \"import/no-unresolved\": \"off\",\n },\n settings: {\n // Append 'ts' extensions to 'import/extensions' setting\n \"import/extensions\": [\".js\", \".mjs\", \".jsx\", \".ts\", \".tsx\", \".d.ts\", \".cjs\", \".cts\", \".mts\"],\n\n // Resolve type definition packages\n \"import/external-module-folders\": [\"node_modules\", \"node_modules/@types\"],\n\n // Apply special parsing for TypeScript files\n \"import/parsers\": {\n \"@typescript-eslint/parser\": [\".ts\", \".cts\", \".mts\", \".tsx\", \".d.ts\"],\n },\n\n // Append 'ts' extensions to 'import/resolver' setting\n \"import/resolver\": {\n node: {\n extensions: [\".mjs\", \".cjs\", \".js\", \".json\", \".ts\", \".d.ts\"],\n },\n typescript: true,\n },\n },\n },\n type: \"typescript\",\n },\n {\n config: {\n rules: {\n \"import/no-duplicates\": \"off\",\n },\n },\n type: \"d.ts\",\n },\n]);\n\nexport default config;\n"]}
|
|
1
|
+
{"version":3,"sources":["../../../src/config/plugins/import.ts"],"names":["fromRoot","packageIsTypeModule","projectPath","eslint_config_default","config","createConfigs","import_default"],"mappings":"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","sourcesContent":["import { fromRoot, packageIsTypeModule, projectPath } from \"@anolilab/package-json-utils\";\nimport type { Linter } from \"eslint\";\n\nimport { createConfigs } from \"../../utils/create-config\";\nimport anolilabEslintConfig from \"../../utils/eslint-config\";\n\nif (global.anolilabEslintImportNoUnusedModulesConfig === undefined && anolilabEslintConfig[\"import_ignore_exports\"]) {\n if (!Array.isArray(anolilabEslintConfig[\"import_ignore_exports\"])) {\n throw new TypeError(\"import.ignore_exports must be a array\");\n }\n\n global.anolilabEslintImportNoUnusedModulesConfig = anolilabEslintConfig[\"import_ignore_exports\"] as string[];\n}\n\nconst config: Linter.Config = createConfigs([\n {\n config: {\n env: {\n es6: true,\n },\n\n parserOptions: {\n ecmaVersion: 6,\n sourceType: \"module\",\n },\n plugins: [\"import\"],\n rules: {\n // enforce a consistent style for type specifiers (inline or top-level)\n // https://github.com/un-es/eslint-plugin-i/blob/d5fc8b670dc8e6903dbb7b0894452f60c03089f5/docs/rules/consistent-type-specifier-style.md\n \"import/consistent-type-specifier-style\": [\"error\", \"prefer-top-level\"],\n\n // ensure named imports coupled with named exports\n // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/default.md#when-not-to-use-it\n \"import/default\": \"off\",\n\n // dynamic imports require a leading comment with a webpackChunkName\n // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/dynamic-import-chunkname.md\n \"import/dynamic-import-chunkname\": [\n \"off\",\n {\n importFunctions: [],\n webpackChunknameFormat: \"[0-9a-zA-Z-_/.]+\",\n },\n ],\n\n // disallow invalid exports, e.g. multiple defaults\n // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/export.md\n \"import/export\": \"error\",\n\n // This rule enforces that all exports are declared at the bottom of the file.\n // https://github.com/import-js/eslint-plugin-import/blob/98acd6afd04dcb6920b81330114e146dc8532ea4/docs/rules/exports-last.md\n \"import/exports-last\": \"error\",\n\n // Ensure consistent use of file extension within the import path\n // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/extensions.md\n \"import/extensions\": [\n \"error\",\n \"ignorePackages\",\n packageIsTypeModule\n ? {\n cjs: \"always\",\n js: \"always\",\n jsx: \"always\",\n mjs: \"always\",\n json: \"always\",\n }\n : {\n cjs: \"never\",\n js: \"never\",\n jsx: \"never\",\n mjs: \"never\",\n json: \"always\",\n },\n ],\n\n // disallow non-import statements appearing before import statements\n // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/first.md\n \"import/first\": \"error\",\n\n // Reports when named exports are not grouped together in a single export declaration\n // or when multiple assignments to CommonJS module.exports or exports object are present\n // in a single file.\n // https://github.com/import-js/eslint-plugin-import/blob/44a038c06487964394b1e15b64f3bd34e5d40cde/docs/rules/group-exports.md\n \"import/group-exports\": \"off\",\n\n // disallow non-import statements appearing before import statements\n // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/imports-first.md\n // deprecated: use `import/first`\n \"import/imports-first\": \"off\",\n\n // \"import/max-dependencies\" is not super useful\n // Either you will disable the eslint rule because it's \"normal\"\n // to have a lot of dependencies or feel compelled to reduce the number of imports.\n // It's already visible that a file has many imports and that ideally they should be\n // less imports, no need for ESLint, let's keep ESLint for more valuable things.\n // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/max-dependencies.md\n \"import/max-dependencies\": [\"off\", { max: 10 }],\n\n // disallow require()\n // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/named.md#when-not-to-use-it\n \"import/named\": \"error\",\n\n // disallow AMD require/define\n // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/namespace.md\n \"import/namespace\": \"off\",\n\n // Require a newline after the last import/require in a group\n // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/newline-after-import.md\n \"import/newline-after-import\": \"error\",\n\n // Forbid import of modules using absolute paths\n // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-absolute-path.md\n \"import/no-absolute-path\": \"error\",\n\n // disallow AMD require/define\n // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-amd.md\n \"import/no-amd\": \"error\",\n\n // Reports if a module's default export is unnamed\n // https://github.com/import-js/eslint-plugin-import/blob/d9b712ac7fd1fddc391f7b234827925c160d956f/docs/rules/no-anonymous-default-export.md\n \"import/no-anonymous-default-export\": [\n \"off\",\n {\n allowAnonymousClass: false,\n allowAnonymousFunction: false,\n allowArray: false,\n allowArrowFunction: false,\n allowLiteral: false,\n allowObject: false,\n },\n ],\n\n // disallow require()\n // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-commonjs.md\n \"import/no-commonjs\": packageIsTypeModule ? [\"error\", { allowPrimitiveModules: true }] : \"off\",\n\n // Forbid cyclical dependencies between modules\n // https://medium.com/@steven-lemon182/are-typescript-barrel-files-an-anti-pattern-72a713004250\n \"import/no-cycle\": [\"error\", { maxDepth: \"∞\" }],\n\n // forbid default exports. this is a terrible rule, do not use it.\n // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-default-export.md\n \"import/no-default-export\": \"off\",\n\n // disallow use of jsdoc-marked-deprecated imports\n // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-deprecated.md\n \"import/no-deprecated\": \"off\",\n\n // disallow duplicate imports\n // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-duplicates.md\n \"import/no-duplicates\": \"error\",\n\n // Forbid require() calls with expressions\n // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-dynamic-require.md\n \"import/no-dynamic-require\": \"error\",\n\n // Reports the use of empty named import blocks.\n // https://github.com/un-es/eslint-plugin-i/blob/d5fc8b670dc8e6903dbb7b0894452f60c03089f5/docs/rules/no-empty-named-blocks.md\n \"import/no-empty-named-blocks\": \"error\",\n\n // Forbid the use of extraneous packages\n // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-extraneous-dependencies.md\n // paths are treated both as absolute paths, and relative to process.cwd()\n \"import/no-extraneous-dependencies\": [\n \"error\",\n {\n devDependencies: [\n \"test/**\", // tape, common npm pattern\n \"tests/**\", // also common npm pattern\n \"spec/**\", // mocha, rspec-like pattern\n \"**/fixture/**\", // jest pattern\n \"**/__mocks__/**\", // jest pattern\n \"test.{js,jsx}\", // repos with a single test file\n \"test-*.{js,jsx}\", // repos with multiple top-level test files\n \"**/*{.,_}{test,spec}.{js,jsx}\", // tests where the extension or filename suffix denotes that it is a test\n \"**/jest.config.cjs\", // jest config\n \"**/jest.setup.js\", // jest setup\n \"**/vue.config.cjs\", // vue-cli config\n \"**/webpack.config.cjs\", // webpack config\n \"**/webpack.config.*.js\", // webpack config\n \"**/rollup.config.cjs\", // rollup config\n \"**/rollup.config.*.js\", // rollup config\n \"**/gulpfile.js\", // gulp config\n \"**/gulpfile.*.js\", // gulp config\n \"**/Gruntfile{,.js}\", // grunt config\n \"**/protractor.conf.js\", // protractor config\n \"**/protractor.conf.*.js\", // protractor config\n \"**/karma.conf.js\", // karma config\n \"**/.eslintrc.js\", // eslint config\n \"**/.eslintrc.cjs\", // eslint config\n \"**/.eslintrc.mjs\", // eslint config\n \"**/eslint.config.js\", // eslint flat config\n \"**/eslint.config.mjs\", // eslint flat config\n \"**/eslint.config.cjs\", // eslint flat config\n \"**/vite.config.js\", // vite config\n \"**/vite.config.ts\", // vite config\n \"**/vitest.config.js\", // vitest config\n \"**/vitest.config.ts\", // vitest config\n \"**/__tests__/**/*.?(c|m)[jt]s?(x)\", // vitest config test include\n \"**/?(*.){test,spec}.?(c|m)[jt]s?(x)\", // vitest config test include\n ],\n optionalDependencies: false,\n },\n ],\n\n // prevent importing the submodules of other modules\n // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-internal-modules.md\n \"import/no-internal-modules\": [\n \"off\",\n {\n allow: [],\n },\n ],\n\n // Forbid mutable exports\n // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-mutable-exports.md\n \"import/no-mutable-exports\": \"error\",\n\n // Warn if a module could be mistakenly parsed as a script by a consumer\n // leveraging Unambiguous JavaScript Grammar\n // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/unambiguous.md\n // this should not be enabled until this proposal has at least been *presented* to TC39.\n // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-named-as-default.md\n \"import/no-named-as-default\": \"error\",\n\n // warn on accessing default export property names that are also named exports\n // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-named-as-default-member.md\n \"import/no-named-as-default-member\": \"error\",\n\n // Prevent importing the default as if it were named\n // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-named-default.md\n \"import/no-named-default\": \"error\",\n\n // Prohibit named exports. this is a terrible rule, do not use it.\n // https://github.com/import-js/eslint-plugin-import/blob/1ec80fa35fa1819e2d35a70e68fb6a149fb57c5e/docs/rules/no-named-export.md\n \"import/no-named-export\": \"off\",\n\n // disallow namespace imports\n // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-namespace.md\n \"import/no-namespace\": \"error\",\n\n // No Node.js builtin modules\n // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-nodejs-modules.md\n // TODO: enable?\n \"import/no-nodejs-modules\": \"off\",\n\n // Use this rule to prevent imports to folders in relative parent paths.\n // https://github.com/import-js/eslint-plugin-import/blob/c34f14f67f077acd5a61b3da9c0b0de298d20059/docs/rules/no-relative-parent-imports.md\n \"import/no-relative-parent-imports\": \"off\",\n\n // Restrict which files can be imported in a given folder\n // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-restricted-paths.md\n \"import/no-restricted-paths\": \"off\",\n\n // Forbid a module from importing itself\n // https://github.com/import-js/eslint-plugin-import/blob/44a038c06487964394b1e15b64f3bd34e5d40cde/docs/rules/no-self-import.md\n \"import/no-self-import\": \"error\",\n\n // Forbid a module from importing itself\n // importing for side effects is perfectly acceptable, if you need side effects.\n \"import/no-unassigned-import\": \"off\",\n\n // ensure imports point to files/modules that can be resolved\n // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-unresolved.md\n \"import/no-unresolved\": [\"error\", { caseSensitive: true, commonjs: true }],\n\n // Reports modules without any exports, or with unused exports\n // https://github.com/import-js/eslint-plugin-import/blob/f63dd261809de6883b13b6b5b960e6d7f42a7813/docs/rules/no-unused-modules.md\n \"import/no-unused-modules\": [\n packageIsTypeModule ? \"error\" : \"off\",\n {\n ignoreExports: global.anolilabEslintImportNoUnusedModulesConfig ?? [],\n missingExports: true,\n unusedExports: true,\n },\n ],\n\n // Reports the use of import declarations with CommonJS exports in any module except for the main module.\n // https://github.com/import-js/eslint-plugin-import/blob/1012eb951767279ce3b540a4ec4f29236104bb5b/docs/rules/no-import-module-exports.md\n \"import/no-import-module-exports\": [\n packageIsTypeModule ? \"off\" : \"error\",\n {\n exceptions: [],\n },\n ],\n\n // Use this rule to prevent importing packages through relative paths.\n // https://github.com/import-js/eslint-plugin-import/blob/1012eb951767279ce3b540a4ec4f29236104bb5b/docs/rules/no-relative-packages.md\n \"import/no-relative-packages\": \"error\",\n\n // Ensures that there are no useless path segments\n // TODO: Create a PR to fix commonjs option, when eslint --fix is run, it throws an error on the no-useless-path-segments.js:118\n // @see https://github.com/import-js/eslint-plugin-import/pull/2886\n // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-useless-path-segments.md\n \"import/no-useless-path-segments\": [\"error\", { commonjs: false, noUselessIndex: true }],\n\n // Forbid Webpack loader syntax in imports\n // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-webpack-loader-syntax.md\n \"import/no-webpack-loader-syntax\": \"error\",\n\n // ensure absolute imports are above relative imports and that unassigned imports are ignored\n // https://github.com/import-js/eslint-plugin-import/blob/f63dd261809de6883b13b6b5b960e6d7f42a7813/docs/rules/no-unused-modules.md\n // simple-import-sort does this better\n \"import/order\": \"off\",\n\n // Require modules with a single export to use a default export\n // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/prefer-default-export.md\n \"import/prefer-default-export\": \"error\",\n\n // Warn if a module could be mistakenly parsed as a script by a consumer\n // leveraging Unambiguous JavaScript Grammar\n // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/unambiguous.md\n // this should not be enabled until this proposal has at least been *presented* to TC39.\n // At the moment, it's not a thing.\n \"import/unambiguous\": \"off\",\n },\n settings: {\n \"import/core-modules\": [],\n // https://github.com/un-es/eslint-plugin-i/blob/main/docs/rules/extensions.md\n \"import/extensions\": [\".js\", \".cjs\", \".mjs\", \".jsx\"],\n // Ensure consistent use of file extension within the import path\n \"import/ignore\": [\"\\\\.(coffee|scss|css|less|hbs|svg|json)$\"],\n },\n },\n type: \"all\",\n },\n {\n config: {\n settings: {\n \"import/resolver\": {\n \"@jsenv/eslint-import-resolver\": {\n rootDirectoryUrl: projectPath,\n packageConditions: [\"node\", \"import\"],\n },\n },\n },\n },\n type: \"javascript\",\n },\n {\n config: {\n extends: [\"plugin:import/typescript\"],\n rules: {\n // Does not work when the TS definition exports a default const.\n \"import/default\": \"off\",\n\n // Disabled because of https://github.com/import-js/eslint-plugin-import/issues/1590\n \"import/export\": \"off\",\n\n // Disabled as it doesn't work with TypeScript.\n \"import/extensions\": [\n \"error\",\n \"ignorePackages\",\n {\n js: \"never\",\n jsx: \"never\",\n mjs: \"never\",\n cjs: \"never\",\n ts: \"never\",\n tsx: \"never\",\n json: \"always\",\n svg: \"always\",\n },\n ],\n\n // This issue and some others: https://github.com/import-js/eslint-plugin-import/issues/1341\n \"import/named\": \"off\",\n\n // ensure imports point to files/modules that can be resolved\n \"import/no-unresolved\": \"off\",\n },\n settings: {\n // Append 'ts' extensions to 'import/extensions' setting\n \"import/extensions\": [\".js\", \".mjs\", \".jsx\", \".ts\", \".tsx\", \".d.ts\", \".cjs\", \".cts\", \".mts\"],\n\n // Resolve type definition packages\n \"import/external-module-folders\": [\"node_modules\", \"node_modules/@types\"],\n\n // Apply special parsing for TypeScript files\n \"import/parsers\": {\n \"@typescript-eslint/parser\": [\".ts\", \".cts\", \".mts\", \".tsx\", \".d.ts\"],\n },\n\n // Append 'ts' extensions to 'import/resolver' setting\n \"import/resolver\": {\n typescript: {\n alwaysTryTypes: true, // always try to resolve types under `<root>@types` directory even it doesn't contain any source code, like `@types/unist`\n project: fromRoot(\"tsconfig.json\"),\n },\n },\n },\n },\n type: \"typescript\",\n },\n {\n config: {\n rules: {\n \"import/no-duplicates\": \"off\",\n },\n },\n type: \"d.ts\",\n },\n]);\n\nexport default config;\n"]}
|
|
@@ -5,7 +5,7 @@ require('../../chunk-MFE6DF6Y.js');
|
|
|
5
5
|
var packageJsonUtils = require('@anolilab/package-json-utils');
|
|
6
6
|
|
|
7
7
|
global.anolilabEslintConfigJsDocRules===void 0&&packageJsonUtils.hasTypescript&&(packageJsonUtils.hasDependency("eslint-plugin-tsdoc")||packageJsonUtils.hasDevDependency("eslint-plugin-tsdoc")?chunkSEYYGHPU_js.b(`
|
|
8
|
-
Found eslint-plugin-tsdoc as dependency, disabling the jsdoc rules for *.ts and *.tsx files.`):global.anolilabEslintConfigJsDocRules=[{extends:["plugin:jsdoc/recommended-typescript-error"],files:["
|
|
8
|
+
Found eslint-plugin-tsdoc as dependency, disabling the jsdoc rules for *.ts and *.tsx files.`):global.anolilabEslintConfigJsDocRules=[{extends:["plugin:jsdoc/recommended-typescript-error"],files:["**/*.ts","**/*.tsx","**/*.mts","**/*.cts"],plugins:["jsdoc"]}]);var i={overrides:[{extends:["plugin:jsdoc/recommended-error"],files:["**/*.js","**/*.jsx","**/*.mjs","**/*.cjs"],plugins:["jsdoc"]},...global.anolilabEslintConfigJsDocRules??[]]},d=i;
|
|
9
9
|
|
|
10
10
|
module.exports = d;
|
|
11
11
|
//# sourceMappingURL=out.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/config/plugins/jsdoc.ts"],"names":["hasDependency","hasDevDependency","hasTypescript","consoleLog","config","jsdoc_default"],"mappings":"4EAAA,OAAS,iBAAAA,EAAe,oBAAAC,EAAkB,iBAAAC,MAAqB,+BAK3D,OAAO,iCAAmC,QAAaA,IACnDF,EAAc,qBAAqB,GAAKC,EAAiB,qBAAqB,EAC9EE,EAAW;AAAA,6FAAgG,EAE3G,OAAO,+BAAiC,CACpC,CACI,QAAS,CAAC,2CAA2C,EACrD,MAAO,CAAC,
|
|
1
|
+
{"version":3,"sources":["../../../src/config/plugins/jsdoc.ts"],"names":["hasDependency","hasDevDependency","hasTypescript","consoleLog","config","jsdoc_default"],"mappings":"4EAAA,OAAS,iBAAAA,EAAe,oBAAAC,EAAkB,iBAAAC,MAAqB,+BAK3D,OAAO,iCAAmC,QAAaA,IACnDF,EAAc,qBAAqB,GAAKC,EAAiB,qBAAqB,EAC9EE,EAAW;AAAA,6FAAgG,EAE3G,OAAO,+BAAiC,CACpC,CACI,QAAS,CAAC,2CAA2C,EACrD,MAAO,CAAC,UAAW,WAAY,WAAY,UAAU,EACrD,QAAS,CAAC,OAAO,CACrB,CACJ,GAIR,IAAMC,EAAwB,CAC1B,UAAW,CACP,CACI,QAAS,CAAC,gCAAgC,EAC1C,MAAO,CAAC,UAAW,WAAY,WAAY,UAAU,EACrD,QAAS,CAAC,OAAO,CACrB,EACA,GAAI,OAAO,gCAAkC,CAAC,CAClD,CACJ,EAEOC,EAAQD","sourcesContent":["import { hasDependency, hasDevDependency, hasTypescript } from \"@anolilab/package-json-utils\";\nimport type { Linter } from \"eslint\";\n\nimport { consoleLog } from \"../../utils/loggers\";\n\nif (global.anolilabEslintConfigJsDocRules === undefined && hasTypescript) {\n if (hasDependency(\"eslint-plugin-tsdoc\") || hasDevDependency(\"eslint-plugin-tsdoc\")) {\n consoleLog(\"\\nFound eslint-plugin-tsdoc as dependency, disabling the jsdoc rules for *.ts and *.tsx files.\");\n } else {\n global.anolilabEslintConfigJsDocRules = [\n {\n extends: [\"plugin:jsdoc/recommended-typescript-error\"],\n files: [\"**/*.ts\", \"**/*.tsx\", \"**/*.mts\", \"**/*.cts\"],\n plugins: [\"jsdoc\"],\n },\n ];\n }\n}\n\nconst config: Linter.Config = {\n overrides: [\n {\n extends: [\"plugin:jsdoc/recommended-error\"],\n files: [\"**/*.js\", \"**/*.jsx\", \"**/*.mjs\", \"**/*.cjs\"],\n plugins: [\"jsdoc\"],\n },\n ...(global.anolilabEslintConfigJsDocRules ?? []),\n ],\n};\n\nexport default config;\n"]}
|
|
@@ -10,7 +10,7 @@ var t=[];(packageJsonUtils.hasDependency("prettier")||packageJsonUtils.hasDevDep
|
|
|
10
10
|
@anolilab/eslint-config found sort-package-json.
|
|
11
11
|
|
|
12
12
|
Following rules are disabled: jsonc/sort-keys for all package.json files.
|
|
13
|
-
`);}var a={overrides:[{extends:t,files:["
|
|
13
|
+
`);}var a={overrides:[{extends:t,files:["**/*.json","**/*.json5","**/*.jsonc"],parser:"jsonc-eslint-parser"},{extends:["plugin:jsonc/recommended-with-json5"],files:["**/*.json5"]},{extends:["plugin:jsonc/recommended-with-jsonc"],files:["**/*.jsonc"]},{extends:["plugin:jsonc/recommended-with-json"],files:["**/*.json"]},{extends:["plugin:jsonc/recommended-with-json"],files:["package.json"],rules:{"jsonc/sort-keys":global.hasAnolilabEsLintConfigJsoncPackageJsonSort?"off":["error",{order:["publisher","name","displayName","type","version","private","packageManager","description","author","license","funding","homepage","repository","bugs","keywords","categories","sideEffects","exports","main","module","unpkg","jsdelivr","types","typesVersions","bin","icon","files","engines","activationEvents","contributes","scripts","peerDependencies","peerDependenciesMeta","dependencies","optionalDependencies","devDependencies","pnpm","overrides","resolutions","husky","simple-git-hooks","lint-staged","eslintConfig"],pathPattern:"^$"},{order:{type:"asc"},pathPattern:"^(?:dev|peer|optional|bundled)?[Dd]ependencies$"},{order:["types","require","import"],pathPattern:"^exports.*$"}]}}]},g=a;
|
|
14
14
|
|
|
15
15
|
module.exports = g;
|
|
16
16
|
//# sourceMappingURL=out.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/config/plugins/jsonc.ts"],"names":["env","hasDependency","hasDevDependency","extendedPlugins","showLog","eslint_config_default","consoleLog","config","jsonc_default"],"mappings":"wHAAA,OAAS,OAAAA,MAAW,UAEpB,OAAS,iBAAAC,EAAe,oBAAAC,MAAwB,+BAMhD,IAAMC,EAA4B,CAAC,GAE/BF,EAAc,UAAU,GAAKC,EAAiB,UAAU,IACxDC,EAAgB,KAAK,uBAAuB,EAGhD,GAAI,CAAC,OAAO,8CAAgDF,EAAc,mBAAmB,GAAKC,EAAiB,mBAAmB,GAAI,CACtI,OAAO,4CAA8C,GAErD,IAAIE,EAAmBJ,EAAI,iDAAsD,OAE7EI,GAAWC,EAAqB,yCAA8C,SAC9ED,EAAUC,EAAqB,wCAG/BD,GACAE,EAAW;AAAA;AAAA;AAAA;AAAA,CAC8D,CAEjF,CAEA,IAAMC,EAAwB,CAC1B,UAAW,CACP,CACI,QAASJ,EACT,MAAO,CAAC,
|
|
1
|
+
{"version":3,"sources":["../../../src/config/plugins/jsonc.ts"],"names":["env","hasDependency","hasDevDependency","extendedPlugins","showLog","eslint_config_default","consoleLog","config","jsonc_default"],"mappings":"wHAAA,OAAS,OAAAA,MAAW,UAEpB,OAAS,iBAAAC,EAAe,oBAAAC,MAAwB,+BAMhD,IAAMC,EAA4B,CAAC,GAE/BF,EAAc,UAAU,GAAKC,EAAiB,UAAU,IACxDC,EAAgB,KAAK,uBAAuB,EAGhD,GAAI,CAAC,OAAO,8CAAgDF,EAAc,mBAAmB,GAAKC,EAAiB,mBAAmB,GAAI,CACtI,OAAO,4CAA8C,GAErD,IAAIE,EAAmBJ,EAAI,iDAAsD,OAE7EI,GAAWC,EAAqB,yCAA8C,SAC9ED,EAAUC,EAAqB,wCAG/BD,GACAE,EAAW;AAAA;AAAA;AAAA;AAAA,CAC8D,CAEjF,CAEA,IAAMC,EAAwB,CAC1B,UAAW,CACP,CACI,QAASJ,EACT,MAAO,CAAC,YAAa,aAAc,YAAY,EAC/C,OAAQ,qBACZ,EACA,CACI,QAAS,CAAC,qCAAqC,EAC/C,MAAO,CAAC,YAAY,CACxB,EACA,CACI,QAAS,CAAC,qCAAqC,EAC/C,MAAO,CAAC,YAAY,CACxB,EACA,CACI,QAAS,CAAC,oCAAoC,EAC9C,MAAO,CAAC,WAAW,CACvB,EACA,CACI,QAAS,CAAC,oCAAoC,EAC9C,MAAO,CAAC,cAAc,EACtB,MAAO,CAEH,kBAAmB,OAAO,4CACpB,MACA,CACE,QACA,CACI,MAAO,CACH,YACA,OACA,cACA,OACA,UACA,UACA,iBACA,cACA,SACA,UACA,UACA,WACA,aACA,OACA,WACA,aACA,cACA,UACA,OACA,SACA,QACA,WACA,QACA,gBACA,MACA,OACA,QACA,UACA,mBACA,cACA,UACA,mBACA,uBACA,eACA,uBACA,kBACA,OACA,YACA,cACA,QACA,mBACA,cACA,cACJ,EACA,YAAa,IACjB,EACA,CACI,MAAO,CAAE,KAAM,KAAM,EACrB,YAAa,iDACjB,EACA,CACI,MAAO,CAAC,QAAS,UAAW,QAAQ,EACpC,YAAa,aACjB,CACJ,CACR,CACJ,CACJ,CACJ,EAEOK,EAAQD","sourcesContent":["import { env } from \"node:process\";\n\nimport { hasDependency, hasDevDependency } from \"@anolilab/package-json-utils\";\nimport type { Linter } from \"eslint\";\n\nimport anolilabEslintConfig from \"../../utils/eslint-config\";\nimport { consoleLog } from \"../../utils/loggers\";\n\nconst extendedPlugins: string[] = [];\n\nif (hasDependency(\"prettier\") || hasDevDependency(\"prettier\")) {\n extendedPlugins.push(\"plugin:jsonc/prettier\");\n}\n\nif (!global.hasAnolilabEsLintConfigJsoncPackageJsonSort && (hasDependency(\"sort-package-json\") || hasDevDependency(\"sort-package-json\"))) {\n global.hasAnolilabEsLintConfigJsoncPackageJsonSort = true;\n\n let showLog: boolean = env[\"DISABLE_INFO_ON_DISABLING_JSONC_SORT_KEYS_RULE\"] !== \"true\";\n\n if (showLog && anolilabEslintConfig[\"info_on_disabling_jsonc_sort_keys_rule\"] !== undefined) {\n showLog = anolilabEslintConfig[\"info_on_disabling_jsonc_sort_keys_rule\"] as boolean;\n }\n\n if (showLog) {\n consoleLog(`\\n@anolilab/eslint-config found sort-package-json. \\n\n Following rules are disabled: jsonc/sort-keys for all package.json files. \\n`);\n }\n}\n\nconst config: Linter.Config = {\n overrides: [\n {\n extends: extendedPlugins,\n files: [\"**/*.json\", \"**/*.json5\", \"**/*.jsonc\"],\n parser: \"jsonc-eslint-parser\",\n },\n {\n extends: [\"plugin:jsonc/recommended-with-json5\"],\n files: [\"**/*.json5\"],\n },\n {\n extends: [\"plugin:jsonc/recommended-with-jsonc\"],\n files: [\"**/*.jsonc\"],\n },\n {\n extends: [\"plugin:jsonc/recommended-with-json\"],\n files: [\"**/*.json\"],\n },\n {\n extends: [\"plugin:jsonc/recommended-with-json\"],\n files: [\"package.json\"],\n rules: {\n // When the package \"sort-package-json\" is installed, we disable the rule \"jsonc/sort-keys\" because, the package \"sort-package-json\" is responsible for sorting the keys.\n \"jsonc/sort-keys\": global.hasAnolilabEsLintConfigJsoncPackageJsonSort\n ? \"off\"\n : [\n \"error\",\n {\n order: [\n \"publisher\",\n \"name\",\n \"displayName\",\n \"type\",\n \"version\",\n \"private\",\n \"packageManager\",\n \"description\",\n \"author\",\n \"license\",\n \"funding\",\n \"homepage\",\n \"repository\",\n \"bugs\",\n \"keywords\",\n \"categories\",\n \"sideEffects\",\n \"exports\",\n \"main\",\n \"module\",\n \"unpkg\",\n \"jsdelivr\",\n \"types\",\n \"typesVersions\",\n \"bin\",\n \"icon\",\n \"files\",\n \"engines\",\n \"activationEvents\",\n \"contributes\",\n \"scripts\",\n \"peerDependencies\",\n \"peerDependenciesMeta\",\n \"dependencies\",\n \"optionalDependencies\",\n \"devDependencies\",\n \"pnpm\",\n \"overrides\",\n \"resolutions\",\n \"husky\",\n \"simple-git-hooks\",\n \"lint-staged\",\n \"eslintConfig\",\n ],\n pathPattern: \"^$\",\n },\n {\n order: { type: \"asc\" },\n pathPattern: \"^(?:dev|peer|optional|bundled)?[Dd]ependencies$\",\n },\n {\n order: [\"types\", \"require\", \"import\"],\n pathPattern: \"^exports.*$\",\n },\n ],\n },\n },\n ],\n};\n\nexport default config;\n"]}
|
|
@@ -22,7 +22,7 @@ var g=chunkEUR33FQH_js.a.overrides[0].rules,s=g["no-underscore-dangle"];!global.
|
|
|
22
22
|
If you dont use the new react jsx-runtime in you project, please enable it manually.
|
|
23
23
|
`),global.hasAnolilabEsLintConfigReactRuntimePath=e;}return global.hasAnolilabEsLintConfigReactRuntimePath})();if(!global.anolilabEslintConfigReactVersion){let r=packageJsonUtils.getPackageSubProperty("dependencies")("react");if(r===void 0&&(r=packageJsonUtils.getPackageSubProperty("devDependencies")("react")),r!==void 0){let e=semver.parse(r);e!==null&&(global.anolilabEslintConfigReactVersion=`${e.major}.${e.minor}`);}}global.anolilabEslintConfigReactVersion!==void 0&&chunkWW4PDMXQ_js.a.info_on_found_react_version!==!1&&chunkSEYYGHPU_js.b(`
|
|
24
24
|
@anolilab/eslint-config found the version ${global.anolilabEslintConfigReactVersion} of react in your dependencies, this version ${global.anolilabEslintConfigReactVersion} will be used to setup the "eslint-plugin-react"
|
|
25
|
-
`);var x={overrides:[{env:{browser:!0},files:["
|
|
25
|
+
`);var x={overrides:[{env:{browser:!0},files:["**/*.jsx","**/*.tsx"],parserOptions:{ecmaFeatures:{jsx:!0}},plugins:["react"],rules:{"class-methods-use-this":["error",{exceptMethods:["render","getInitialState","getDefaultProps","getChildContext","componentWillMount","UNSAFE_componentWillMount","componentDidMount","componentWillReceiveProps","UNSAFE_componentWillReceiveProps","shouldComponentUpdate","componentWillUpdate","UNSAFE_componentWillUpdate","componentDidUpdate","componentWillUnmount","componentDidCatch","getSnapshotBeforeUpdate"]}],"jsx-quotes":["error","prefer-double"],"no-underscore-dangle":[s[0],{...s[1],allow:[...s[1].allow,"__REDUX_DEVTOOLS_EXTENSION_COMPOSE__"]}],"react/boolean-prop-naming":["off",{message:"",propTypeNames:["bool","mutuallyExclusiveTrueProps"],rule:"^(is|has)[A-Z]([A-Za-z0-9]?)+"}],"react/button-has-type":["error",{button:!0,reset:!1,submit:!0}],"react/default-props-match-prop-types":["error",{allowRequiredDefaults:!1}],"react/destructuring-assignment":["error","always"],"react/display-name":["off",{ignoreTranspilerName:!1}],"react/forbid-component-props":["off",{forbid:[]}],"react/forbid-dom-props":["off",{forbid:[]}],"react/forbid-elements":["off",{forbid:[]}],"react/forbid-foreign-prop-types":["warn",{allowInPropTypes:!0}],"react/forbid-prop-types":["error",{checkChildContextTypes:!0,checkContextTypes:!0,forbid:["any","array","object"]}],"react/function-component-definition":["error",{namedComponents:"arrow-function",unnamedComponents:"arrow-function"}],"react/jsx-boolean-value":["error","never",{always:[]}],"react/jsx-child-element-spacing":"off","react/jsx-closing-bracket-location":["error","line-aligned"],"react/jsx-curly-brace-presence":["error",{children:"never",props:"never"}],"react/jsx-curly-newline":["error",{multiline:"consistent",singleline:"consistent"}],"react/jsx-curly-spacing":["error","never",{allowMultiline:!0}],"react/jsx-equals-spacing":["error","never"],"react/jsx-first-prop-new-line":["error","multiline-multiprop"],"react/jsx-fragments":["error","syntax"],"react/jsx-handler-names":["off",{eventHandlerPrefix:"handle",eventHandlerPropPrefix:"on"}],"react/jsx-indent":["error",chunkR26SPKXH_js.a,{checkAttributes:!0,indentLogicalExpressions:!0}],"react/jsx-indent-props":["error",chunkR26SPKXH_js.a],"react/jsx-key":"off","react/jsx-max-depth":"off","react/jsx-max-props-per-line":["error",{maximum:1,when:"multiline"}],"react/jsx-newline":"off","react/jsx-no-bind":["error",{allowArrowFunctions:!0,allowBind:!1,allowFunctions:!1,ignoreDOMComponents:!0,ignoreRefs:!0}],"react/jsx-no-comment-textnodes":"error","react/jsx-no-constructed-context-values":"error","react/jsx-no-duplicate-props":["error",{ignoreCase:!0}],"react/jsx-no-literals":["off",{noStrings:!0}],"react/jsx-no-script-url":["error",[{name:"Link",props:["to"]}]],"react/jsx-no-target-blank":["error",{enforceDynamicLinks:"always"}],"react/jsx-no-undef":"error","react/jsx-no-useless-fragment":"error","react/jsx-one-expression-per-line":["error",{allow:"single-child"}],"react/jsx-pascal-case":["error",{allowAllCaps:!0,ignore:[]}],"react/jsx-props-no-multi-spaces":"error","react/jsx-props-no-spreading":["error",{custom:"enforce",exceptions:[],explicitSpread:"ignore",html:"enforce"}],"react/jsx-sort-props":"off","react/jsx-space-before-closing":["off","always"],"react/jsx-tag-spacing":["error",{afterOpening:"never",beforeClosing:"never",beforeSelfClosing:"always",closingSlash:"never"}],"react/jsx-uses-react":[c?"off":"error"],"react/jsx-uses-vars":"error","react/no-access-state-in-setstate":"error","react/no-adjacent-inline-elements":"error","react/no-array-index-key":"error","react/no-children-prop":"error","react/no-danger":"warn","react/no-danger-with-children":"error","react/no-deprecated":["error"],"react/no-did-mount-set-state":"off","react/no-did-update-set-state":"error","react/no-direct-mutation-state":"error","react/no-find-dom-node":"error","react/no-is-mounted":"error","react/no-multi-comp":"off","react/no-redundant-should-component-update":"error","react/no-render-return-value":"error","react/no-set-state":"off","react/no-string-refs":"error","react/no-this-in-sfc":"error","react/no-unescaped-entities":"error","react/no-unknown-property":"error","react/no-unsafe":"off","react/no-unused-prop-types":["error",{customValidators:[],skipShapeProps:!0}],"react/no-unused-state":"error","react/no-will-update-set-state":"error","react/prefer-es6-class":["error","always"],"react/prefer-read-only-props":"off","react/prefer-stateless-function":["error",{ignorePureComponents:!0}],"react/prop-types":["error",{customValidators:[],ignore:[],skipUndeclared:!1}],"react/react-in-jsx-scope":c?"off":"error","react/require-default-props":["error",{forbidDefaultForRequired:!0,functions:packageJsonUtils.hasDependency("typescript")||packageJsonUtils.hasDevDependency("typescript")?"defaultArguments":"defaultProps"}],"react/require-optimization":["off",{allowDecorators:[]}],"react/require-render-return":"error","react/self-closing-comp":"error","react/sort-comp":["error",{groups:{lifecycle:["displayName","propTypes","contextTypes","childContextTypes","mixins","statics","defaultProps","constructor","getDefaultProps","getInitialState","state","getChildContext","getDerivedStateFromProps","componentWillMount","UNSAFE_componentWillMount","componentDidMount","componentWillReceiveProps","UNSAFE_componentWillReceiveProps","shouldComponentUpdate","componentWillUpdate","UNSAFE_componentWillUpdate","getSnapshotBeforeUpdate","componentDidUpdate","componentDidCatch","componentWillUnmount"],rendering:["/^render.+$/","render"]},order:["static-variables","static-methods","instance-variables","lifecycle","/^handle.+$/","/^on.+$/","getters","setters","/^(get|set)(?!(InitialState$|DefaultProps$|ChildContext$)).+$/","instance-methods","everything-else","rendering"]}],"react/sort-default-props":["error",{ignoreCase:!0}],"react/sort-prop-types":["off",{callbacksLast:!1,ignoreCase:!0,requiredFirst:!1,sortShapeProp:!0}],"react/state-in-constructor":["error","always"],"react/static-property-placement":["error","property assignment"],"react/style-prop-object":"error","react/void-dom-elements-no-children":"error",...global.anolilabEslintConfigReactPrettierRules},settings:{propWrapperFunctions:["forbidExtraProps","exact","Object.freeze"],react:{version:global.anolilabEslintConfigReactVersion??"detect"}}},{files:["**/*.jsx"],parser:"@babel/eslint-parser",parserOptions:{ecmaFeatures:{jsx:!0}},settings:{extensions:[".jsx"]},rules:{"react/jsx-closing-tag-location":"error","react/jsx-filename-extension":"error","react/jsx-wrap-multilines":["error",{arrow:"parens-new-line",assignment:"parens-new-line",condition:"parens-new-line",declaration:"parens-new-line",logical:"parens-new-line",prop:"parens-new-line",return:"parens-new-line"}],"react/no-typos":"error"}},{files:["**/*.tsx"],rules:{"react/default-props-match-prop-types":"off","react/jsx-filename-extension":"off","react/prop-types":"off","react/require-default-props":"off"}},{files:["**/*.stories.{ts,tsx,mdx}"],rules:{"react/jsx-props-no-spreading":"off"}}]},E=x;
|
|
26
26
|
|
|
27
27
|
module.exports = E;
|
|
28
28
|
//# sourceMappingURL=out.js.map
|