@eslint/eslintrc
Advanced tools
Comparing version 1.4.1 to 2.0.0
@@ -56,13 +56,2 @@ /** | ||
// check for special settings for eslint:all and eslint:recommended: | ||
if (eslintrcConfig.settings) { | ||
if (eslintrcConfig.settings["eslint:all"] === true) { | ||
return ["eslint:all"]; | ||
} | ||
if (eslintrcConfig.settings["eslint:recommended"] === true) { | ||
return ["eslint:recommended"]; | ||
} | ||
} | ||
// copy over simple translations | ||
@@ -219,3 +208,5 @@ for (const key of keysToCopy) { | ||
baseDirectory = process.cwd(), | ||
resolvePluginsRelativeTo = baseDirectory | ||
resolvePluginsRelativeTo = baseDirectory, | ||
recommendedConfig, | ||
allConfig | ||
} = {}) { | ||
@@ -227,4 +218,18 @@ this.baseDirectory = baseDirectory; | ||
resolvePluginsRelativeTo, | ||
getEslintAllConfig: () => ({ settings: { "eslint:all": true } }), | ||
getEslintRecommendedConfig: () => ({ settings: { "eslint:recommended": true } }) | ||
getEslintAllConfig: () => { | ||
if (!allConfig) { | ||
throw new TypeError("Missing parameter 'allConfig' in FlatCompat constructor."); | ||
} | ||
return allConfig; | ||
}, | ||
getEslintRecommendedConfig: () => { | ||
if (!recommendedConfig) { | ||
throw new TypeError("Missing parameter 'recommendedConfig' in FlatCompat constructor."); | ||
} | ||
return recommendedConfig; | ||
} | ||
}); | ||
@@ -231,0 +236,0 @@ } |
{ | ||
"name": "@eslint/eslintrc", | ||
"version": "1.4.1", | ||
"version": "2.0.0", | ||
"description": "The legacy ESLintRC config file format for ESLint", | ||
@@ -5,0 +5,0 @@ "type": "module", |
@@ -25,2 +25,3 @@ # ESLintRC Library | ||
import { FlatCompat } from "@eslint/eslintrc"; | ||
import js from "@eslint/js"; | ||
import path from "path"; | ||
@@ -34,4 +35,6 @@ import { fileURLToPath } from "url"; | ||
const compat = new FlatCompat({ | ||
baseDirectory: __dirname, // optional; default: process.cwd() | ||
resolvePluginsRelativeTo: __dirname // optional | ||
baseDirectory: __dirname, // optional; default: process.cwd() | ||
resolvePluginsRelativeTo: __dirname, // optional | ||
recommendedConfig: js.configs.recommended, // optional | ||
allConfig: js.configs.all, // optional | ||
}); | ||
@@ -38,0 +41,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
652699
8800
72