@anolilab/eslint-config 14.0.10 → 14.0.11

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 CHANGED
@@ -1,3 +1,21 @@
1
+ ## @anolilab/eslint-config [14.0.11](https://github.com/anolilab/javascript-style-guide/compare/@anolilab/eslint-config@14.0.10...@anolilab/eslint-config@14.0.11) (2023-09-27)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * Update import/no-useless-path-segments rule and eslint dependency versions ([e265315](https://github.com/anolilab/javascript-style-guide/commit/e265315c4c864d9a23001aee6159017655586ace))
7
+
8
+
9
+ ### Miscellaneous Chores
10
+
11
+ * **deps:** update devdependencies ([#766](https://github.com/anolilab/javascript-style-guide/issues/766)) ([ef64bea](https://github.com/anolilab/javascript-style-guide/commit/ef64bea2701995c85b9d1a0ad07ec4da6f7e4b25))
12
+
13
+
14
+
15
+ ### Dependencies
16
+
17
+ * **@anolilab/semantic-release-preset:** upgraded to 7.0.4
18
+
1
19
  ## @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
20
 
3
21
 
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
- // eslint-disable-next-line import/extensions
2
+
3
3
  require("../dist/postinstall");
@@ -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 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;
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:!0,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","packageIsTypeModule","projectPath","eslint_config_default","config","createConfigs","import_default"],"mappings":"wHAAA,OAAS,YAAAA,EAAU,uBAAAC,EAAqB,eAAAC,MAAmB,+BAM3D,GAAI,OAAO,4CAA8C,QAAaC,EAAqB,sBAA0B,CACjH,GAAI,CAAC,MAAM,QAAQA,EAAqB,qBAAwB,EAC5D,MAAM,IAAI,UAAU,uCAAuC,EAG/D,OAAO,0CAA4CA,EAAqB,qBAC5E,CAEA,IAAMC,EAAwBC,EAAc,CACxC,CACI,OAAQ,CACJ,IAAK,CACD,IAAK,EACT,EAEA,cAAe,CACX,YAAa,EACb,WAAY,QAChB,EACA,QAAS,CAAC,QAAQ,EAClB,MAAO,CAGH,yCAA0C,CAAC,QAAS,kBAAkB,EAItE,iBAAkB,MAIlB,kCAAmC,CAC/B,MACA,CACI,gBAAiB,CAAC,EAClB,uBAAwB,kBAC5B,CACJ,EAIA,gBAAiB,QAIjB,sBAAuB,QAIvB,oBAAqB,CACjB,QACA,iBACAJ,EACM,CACE,IAAK,SACL,GAAI,SACJ,IAAK,SACL,IAAK,SACL,KAAM,QACV,EACE,CACE,IAAK,QACL,GAAI,QACJ,IAAK,QACL,IAAK,QACL,KAAM,QACV,CACR,EAIA,eAAgB,QAMhB,uBAAwB,MAKxB,uBAAwB,MAQxB,0BAA2B,CAAC,MAAO,CAAE,IAAK,EAAG,CAAC,EAI9C,eAAgB,QAIhB,mBAAoB,MAIpB,8BAA+B,QAI/B,0BAA2B,QAI3B,gBAAiB,QAIjB,qCAAsC,CAClC,MACA,CACI,oBAAqB,GACrB,uBAAwB,GACxB,WAAY,GACZ,mBAAoB,GACpB,aAAc,GACd,YAAa,EACjB,CACJ,EAIA,qBAAsBA,EAAsB,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kBAAmB,CACf,gCAAiC,CAC7B,iBAAkBC,EAClB,kBAAmB,CAAC,OAAQ,QAAQ,CACxC,CACJ,CACJ,CACJ,EACA,KAAM,YACV,EACA,CACI,OAAQ,CACJ,QAAS,CAAC,0BAA0B,EACpC,MAAO,CAEH,iBAAkB,MAGlB,gBAAiB,MAGjB,oBAAqB,CACjB,QACA,iBACA,CACI,GAAI,QACJ,IAAK,QACL,IAAK,QACL,IAAK,QACL,GAAI,QACJ,IAAK,QACL,KAAM,SACN,IAAK,QACT,CACJ,EAGA,eAAgB,MAGhB,uBAAwB,KAC5B,EACA,SAAU,CAEN,oBAAqB,CAAC,MAAO,OAAQ,OAAQ,MAAO,OAAQ,QAAS,OAAQ,OAAQ,MAAM,EAG3F,iCAAkC,CAAC,eAAgB,qBAAqB,EAGxE,iBAAkB,CACd,4BAA6B,CAAC,MAAO,OAAQ,OAAQ,OAAQ,OAAO,CACxE,EAGA,kBAAmB,CACf,WAAY,CACR,eAAgB,GAChB,QAASF,EAAS,eAAe,CACrC,CACJ,CACJ,CACJ,EACA,KAAM,YACV,EACA,CACI,OAAQ,CACJ,MAAO,CACH,uBAAwB,KAC5B,CACJ,EACA,KAAM,MACV,CACJ,CAAC,EAEMM,EAAQF","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"]}
1
+ {"version":3,"sources":["../../../src/config/plugins/import.ts"],"names":["fromRoot","packageIsTypeModule","projectPath","eslint_config_default","config","createConfigs","import_default"],"mappings":"wHAAA,OAAS,YAAAA,EAAU,uBAAAC,EAAqB,eAAAC,MAAmB,+BAM3D,GAAI,OAAO,4CAA8C,QAAaC,EAAqB,sBAA0B,CACjH,GAAI,CAAC,MAAM,QAAQA,EAAqB,qBAAwB,EAC5D,MAAM,IAAI,UAAU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,MAAO,OAAQ,OAAQ,MAAO,OAAQ,QAAS,OAAQ,OAAQ,MAAM,EAG3F,iCAAkC,CAAC,eAAgB,qBAAqB,EAGxE,iBAAkB,CACd,4BAA6B,CAAC,MAAO,OAAQ,OAAQ,OAAQ,OAAO,CACxE,EAGA,kBAAmB,CACf,WAAY,CACR,eAAgB,GAChB,QAASF,EAAS,eAAe,CACrC,CACJ,CACJ,CACJ,EACA,KAAM,YACV,EACA,CACI,OAAQ,CACJ,MAAO,CACH,uBAAwB,KAC5B,CACJ,EACA,KAAM,MACV,CACJ,CAAC,EAEMM,EAAQF","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 // 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: true, 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"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anolilab/eslint-config",
3
- "version": "14.0.10",
3
+ "version": "14.0.11",
4
4
  "description": "ESLint shareable config for the Anolilab JavaScript style guide.",
5
5
  "keywords": [
6
6
  "anolilab",
@@ -131,12 +131,12 @@
131
131
  "@anolilab/package-json-utils": "3.0.6",
132
132
  "@babel/eslint-parser": "^7.22.15",
133
133
  "@babel/plugin-syntax-import-assertions": "^7.22.5",
134
- "@jsenv/eslint-import-resolver": "^8.0.2",
134
+ "@jsenv/eslint-import-resolver": ">=8.0.3",
135
135
  "@eslint/js": "^8.50.0",
136
136
  "@html-eslint/eslint-plugin": "^0.19.1",
137
137
  "@html-eslint/parser": "^0.19.1",
138
- "@rushstack/eslint-patch": "^1.4.0",
139
- "@rushstack/eslint-plugin-security": "^0.7.0",
138
+ "@rushstack/eslint-patch": "^1.5.0",
139
+ "@rushstack/eslint-plugin-security": "^0.7.1",
140
140
  "@typescript-eslint/eslint-plugin": ">=6.7.3",
141
141
  "@typescript-eslint/parser": "^6.7.3",
142
142
  "confusing-browser-globals": "^1.0.11",
@@ -174,7 +174,7 @@
174
174
  "yaml-eslint-parser": "^1.2.2"
175
175
  },
176
176
  "devDependencies": {
177
- "@anolilab/semantic-release-preset": "7.0.3",
177
+ "@anolilab/semantic-release-preset": "7.0.4",
178
178
  "@arthurgeron/eslint-plugin-react-usememo": "^2.0.1",
179
179
  "@testing-library/dom": "^9.3.3",
180
180
  "@total-typescript/ts-reset": "^0.5.1",
@@ -210,10 +210,10 @@
210
210
  "eslint-plugin-zod": "^1.4.0",
211
211
  "jest": "^29.7.0",
212
212
  "react": "^18.2.0",
213
- "rimraf": "^5.0.2",
213
+ "rimraf": "^5.0.5",
214
214
  "semantic-release": "^21.1.2",
215
215
  "tsup": "^7.2.0",
216
- "type-fest": "^4.3.1",
216
+ "type-fest": "^4.3.2",
217
217
  "typescript": "^5.2.2",
218
218
  "vitest": "^0.34.5"
219
219
  },