@codacy/tools-eslint-9 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +42 -0
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -25710,6 +25710,32 @@ function extractPluginPrefix(ruleId) {
|
|
|
25710
25710
|
// src/config-builder.ts
|
|
25711
25711
|
var TOOL_ID = "ESLint9";
|
|
25712
25712
|
var PREFIX = `${TOOL_ID}_`;
|
|
25713
|
+
var CORE_TO_TS_EXTENSION = /* @__PURE__ */ new Map([
|
|
25714
|
+
["class-methods-use-this", "@typescript-eslint/class-methods-use-this"],
|
|
25715
|
+
["consistent-return", "@typescript-eslint/consistent-return"],
|
|
25716
|
+
["default-param-last", "@typescript-eslint/default-param-last"],
|
|
25717
|
+
["dot-notation", "@typescript-eslint/dot-notation"],
|
|
25718
|
+
["init-declarations", "@typescript-eslint/init-declarations"],
|
|
25719
|
+
["max-params", "@typescript-eslint/max-params"],
|
|
25720
|
+
["no-array-constructor", "@typescript-eslint/no-array-constructor"],
|
|
25721
|
+
["no-dupe-class-members", "@typescript-eslint/no-dupe-class-members"],
|
|
25722
|
+
["no-empty-function", "@typescript-eslint/no-empty-function"],
|
|
25723
|
+
["no-implied-eval", "@typescript-eslint/no-implied-eval"],
|
|
25724
|
+
["no-invalid-this", "@typescript-eslint/no-invalid-this"],
|
|
25725
|
+
["no-loop-func", "@typescript-eslint/no-loop-func"],
|
|
25726
|
+
["no-loss-of-precision", "@typescript-eslint/no-loss-of-precision"],
|
|
25727
|
+
["no-magic-numbers", "@typescript-eslint/no-magic-numbers"],
|
|
25728
|
+
["no-redeclare", "@typescript-eslint/no-redeclare"],
|
|
25729
|
+
["no-restricted-imports", "@typescript-eslint/no-restricted-imports"],
|
|
25730
|
+
["no-shadow", "@typescript-eslint/no-shadow"],
|
|
25731
|
+
["no-unused-expressions", "@typescript-eslint/no-unused-expressions"],
|
|
25732
|
+
["no-unused-vars", "@typescript-eslint/no-unused-vars"],
|
|
25733
|
+
["no-use-before-define", "@typescript-eslint/no-use-before-define"],
|
|
25734
|
+
["no-useless-constructor", "@typescript-eslint/no-useless-constructor"],
|
|
25735
|
+
["prefer-destructuring", "@typescript-eslint/prefer-destructuring"],
|
|
25736
|
+
["prefer-promise-reject-errors", "@typescript-eslint/prefer-promise-reject-errors"],
|
|
25737
|
+
["require-await", "@typescript-eslint/require-await"]
|
|
25738
|
+
]);
|
|
25713
25739
|
function decodePatternId(patternId) {
|
|
25714
25740
|
if (!patternId.startsWith(PREFIX)) return patternId;
|
|
25715
25741
|
const raw = patternId.slice(PREFIX.length);
|
|
@@ -25788,6 +25814,22 @@ async function buildESLintConfig(patterns) {
|
|
|
25788
25814
|
}
|
|
25789
25815
|
configs.push(configItem);
|
|
25790
25816
|
}
|
|
25817
|
+
const tsOverrideRules = {};
|
|
25818
|
+
if (coreRules["no-undef"] !== void 0) {
|
|
25819
|
+
tsOverrideRules["no-undef"] = "off";
|
|
25820
|
+
}
|
|
25821
|
+
const enabledTsRuleIds = new Set(tsRules ? Object.keys(tsRules) : []);
|
|
25822
|
+
for (const [coreRule, tsRule] of CORE_TO_TS_EXTENSION) {
|
|
25823
|
+
if (coreRules[coreRule] !== void 0 && enabledTsRuleIds.has(tsRule)) {
|
|
25824
|
+
tsOverrideRules[coreRule] = "off";
|
|
25825
|
+
}
|
|
25826
|
+
}
|
|
25827
|
+
if (Object.keys(tsOverrideRules).length > 0) {
|
|
25828
|
+
configs.push({
|
|
25829
|
+
files: ["**/*.ts", "**/*.tsx"],
|
|
25830
|
+
rules: tsOverrideRules
|
|
25831
|
+
});
|
|
25832
|
+
}
|
|
25791
25833
|
return configs;
|
|
25792
25834
|
}
|
|
25793
25835
|
function buildRuleValue(pattern) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codacy/tools-eslint-9",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "ESLint 9 adapter — Library-mode JavaScript/TypeScript linter",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
"eslint-plugin-wdio": "^9.0.0",
|
|
80
80
|
"eslint-plugin-xss": "^0.1.0",
|
|
81
81
|
"eslint-plugin-yml": "^1.0.0",
|
|
82
|
-
"@codacy/tooling": "0.
|
|
82
|
+
"@codacy/tooling": "0.4.0"
|
|
83
83
|
},
|
|
84
84
|
"license": "MIT",
|
|
85
85
|
"author": "Codacy <support@codacy.com> (https://www.codacy.com)",
|