@eslint/eslintrc
Advanced tools
Comparing version 0.3.0 to 0.4.0
@@ -0,1 +1,7 @@ | ||
v0.4.0 - February 27, 2021 | ||
* [`d9a527b`](https://github.com/eslint/eslintrc/commit/d9a527bdb16af46a28d37fa9022131149970a438) New: Implement DotCompat class (#20) (Nicholas C. Zakas) | ||
* [`dac76c0`](https://github.com/eslint/eslintrc/commit/dac76c035a9ab9d315050f688867373966aab288) Chore: Replace usage of lodash with cache set (#29) (Tim van der Lippe) | ||
* [`3ae2d77`](https://github.com/eslint/eslintrc/commit/3ae2d770cb810c026de817e6861e25dac111da9f) Update: add AggregateError global to es2021 environment (#28) (Milos Djermanovic) | ||
v0.3.0 - January 15, 2021 | ||
@@ -2,0 +8,0 @@ |
@@ -48,2 +48,3 @@ /** | ||
const newGlobals2021 = { | ||
AggregateError: false, | ||
FinalizationRegistry: false, | ||
@@ -50,0 +51,0 @@ WeakRef: false |
@@ -26,2 +26,3 @@ /** | ||
const naming = require("./shared/naming"); | ||
const { FlatCompat } = require("./flat-compat"); | ||
@@ -50,4 +51,6 @@ //----------------------------------------------------------------------------- | ||
naming | ||
} | ||
}, | ||
FlatCompat | ||
}; |
@@ -12,3 +12,2 @@ /** | ||
const path = require("path"); | ||
const lodash = require("lodash"); | ||
@@ -32,2 +31,4 @@ //------------------------------------------------------------------------------ | ||
const sourceFileErrorCache = new Set(); | ||
/** | ||
@@ -41,3 +42,10 @@ * Emits a deprecation warning containing a given filepath. A new deprecation warning is emitted | ||
*/ | ||
const emitDeprecationWarning = lodash.memoize((source, errorCode) => { | ||
function emitDeprecationWarning(source, errorCode) { | ||
const cacheKey = JSON.stringify({ source, errorCode }); | ||
if (sourceFileErrorCache.has(cacheKey)) { | ||
return; | ||
} | ||
sourceFileErrorCache.add(cacheKey); | ||
const rel = path.relative(process.cwd(), source); | ||
@@ -51,3 +59,3 @@ const message = deprecationWarningMessages[errorCode]; | ||
); | ||
}, (...args) => JSON.stringify(args)); | ||
} | ||
@@ -54,0 +62,0 @@ //------------------------------------------------------------------------------ |
{ | ||
"name": "@eslint/eslintrc", | ||
"version": "0.3.0", | ||
"version": "0.4.0", | ||
"description": "The legacy ESLintRC config file format for ESLint", | ||
@@ -44,2 +44,3 @@ "main": "lib/index.js", | ||
"mocha": "^8.1.1", | ||
"shelljs": "^0.8.4", | ||
"sinon": "^9.2.0", | ||
@@ -56,3 +57,2 @@ "temp-dir": "^2.0.0" | ||
"js-yaml": "^3.13.1", | ||
"lodash": "^4.17.20", | ||
"minimatch": "^3.0.4", | ||
@@ -59,0 +59,0 @@ "strip-json-comments": "^3.1.1" |
@@ -7,3 +7,3 @@ # ESLintRC Library | ||
## Usage | ||
## Installation | ||
@@ -20,4 +20,44 @@ You can install the package as follows: | ||
## Future Usage | ||
**Note:** This package is not intended for public use at this time. The following is an example of how it will be used in the future. | ||
The primary class in this package is `FlatCompat`, which is a utility to translate ESLintRC-style configs into flat configs. Here's how you use it inside of your `eslint.config.js` file: | ||
```js | ||
import { FlatCompat } from "@eslint/eslintrc"; | ||
const compat = new FlatCompat(); | ||
export default [ | ||
// mimic ESLintRC-style extends | ||
compat.extends("standard", "example"), | ||
// mimic environments | ||
compat.env({ | ||
es2020: true, | ||
node: true | ||
}), | ||
// mimic plugins | ||
compat.plugins("airbnb", "react"), | ||
// translate an entire config | ||
compat.config({ | ||
plugins: ["airbnb", "react"], | ||
extends: "standard", | ||
env: { | ||
es2020: true, | ||
node: true | ||
}, | ||
rules: { | ||
semi: "error" | ||
} | ||
}) | ||
]; | ||
``` | ||
## License | ||
MIT License |
156373
9
25
3813
62
11
- Removedlodash@^4.17.20
- Removedlodash@4.17.21(transitive)