@eslint/config-array
Advanced tools
Comparing version 0.19.0 to 0.19.1
@@ -14,2 +14,3 @@ export { ObjectSchema } from "@eslint/object-schema"; | ||
export class ConfigArray extends Array<any> { | ||
[x: symbol]: (config: any) => any; | ||
/** | ||
@@ -53,3 +54,3 @@ * Creates a new instance of ConfigArray. | ||
*/ | ||
get files(): (string | Function)[]; | ||
get files(): Array<string | Function>; | ||
/** | ||
@@ -56,0 +57,0 @@ * Returns ignore matchers that should always be ignored regardless of |
@@ -1253,3 +1253,4 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. | ||
* @returns The normalized path. | ||
*/ function normalizeGlob(glob, { globstar = false } = {}) { | ||
*/ function normalizeGlob(glob, options = {}) { | ||
const { globstar = false } = options; | ||
if (glob.match(/\0/g)) { | ||
@@ -1283,3 +1284,4 @@ throw new Error(`Glob contains invalid characters: "${glob}"`); | ||
* @returns The joined path. | ||
*/ function joinGlobs(globs, { extended = true, globstar = false } = {}) { | ||
*/ function joinGlobs(globs, options = {}) { | ||
const { globstar = false } = options; | ||
if (!globstar || globs.length === 0) { | ||
@@ -1298,3 +1300,2 @@ return join(...globs); | ||
return normalizeGlob(joined, { | ||
extended, | ||
globstar | ||
@@ -1301,0 +1302,0 @@ }); |
@@ -1598,3 +1598,4 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. | ||
* @returns The normalized glob pattern. | ||
*/ function normalizeGlob(glob, { globstar = false } = {}) { | ||
*/ function normalizeGlob(glob, options = {}) { | ||
const { globstar = false } = options; | ||
if (glob.match(/\0/g)) { | ||
@@ -1629,3 +1630,4 @@ throw new Error(`Glob contains invalid characters: "${glob}"`); | ||
* @returns The joined glob pattern. | ||
*/ function joinGlobs(globs, { extended = true, globstar = false } = {}) { | ||
*/ function joinGlobs(globs, options = {}) { | ||
const { globstar = false } = options; | ||
if (!globstar || globs.length === 0) { | ||
@@ -1644,3 +1646,2 @@ return join(...globs); | ||
return normalizeGlob(joined, { | ||
extended, | ||
globstar | ||
@@ -1647,0 +1648,0 @@ }); |
{ | ||
"name": "@eslint/config-array", | ||
"version": "0.19.0", | ||
"version": "0.19.1", | ||
"description": "General purpose glob-based configuration matching.", | ||
@@ -50,3 +50,3 @@ "author": "Nicholas C. Zakas", | ||
"dependencies": { | ||
"@eslint/object-schema": "^2.1.4", | ||
"@eslint/object-schema": "^2.1.5", | ||
"debug": "^4.3.1", | ||
@@ -53,0 +53,0 @@ "minimatch": "^3.1.2" |
@@ -286,6 +286,6 @@ # Config Array | ||
- If a filename is not an absolute path, it will be resolved relative to the base path directory. | ||
- The returned config object never has `files`, `ignores`, or `name` properties; the only properties on the object will be the other configuration options specified. | ||
- The config array caches configs, so subsequent calls to `getConfig()` with the same filename will return in a fast lookup rather than another calculation. | ||
- A config will only be generated if the filename matches an entry in a `files` key. A config will not be generated without matching a `files` key (configs without a `files` key are only applied when another config with a `files` key is applied; configs without `files` are never applied on their own). Any config with a `files` key entry that is `*` or ends with `/**` or `/*` will only be applied if another entry in the same `files` key matches or another config matches. | ||
- If a filename is not an absolute path, it will be resolved relative to the base path directory. | ||
- The returned config object never has `files`, `ignores`, or `name` properties; the only properties on the object will be the other configuration options specified. | ||
- The config array caches configs, so subsequent calls to `getConfig()` with the same filename will return in a fast lookup rather than another calculation. | ||
- A config will only be generated if the filename matches an entry in a `files` key. A config will not be generated without matching a `files` key (configs without a `files` key are only applied when another config with a `files` key is applied; configs without `files` are never applied on their own). Any config with a `files` key entry that is `*` or ends with `/**` or `/*` will only be applied if another entry in the same `files` key matches or another config matches. | ||
@@ -302,7 +302,7 @@ ## Determining Ignored Paths | ||
- **It's parent directory is ignored.** For example, if `foo` is in `ignores`, then `foo/a.js` is considered ignored. | ||
- **It has an ancestor directory that is ignored.** For example, if `foo` is in `ignores`, then `foo/baz/a.js` is considered ignored. | ||
- **It matches an ignored file pattern.** For example, if `**/a.js` is in `ignores`, then `foo/a.js` and `foo/baz/a.js` are considered ignored. | ||
- **If it matches an entry in `files` and also in `ignores`.** For example, if `**/*.js` is in `files` and `**/a.js` is in `ignores`, then `foo/a.js` and `foo/baz/a.js` are considered ignored. | ||
- **The file is outside the `basePath`.** If the `basePath` is `/usr/me`, then `/foo/a.js` is considered ignored. | ||
- **It's parent directory is ignored.** For example, if `foo` is in `ignores`, then `foo/a.js` is considered ignored. | ||
- **It has an ancestor directory that is ignored.** For example, if `foo` is in `ignores`, then `foo/baz/a.js` is considered ignored. | ||
- **It matches an ignored file pattern.** For example, if `**/a.js` is in `ignores`, then `foo/a.js` and `foo/baz/a.js` are considered ignored. | ||
- **If it matches an entry in `files` and also in `ignores`.** For example, if `**/*.js` is in `files` and `**/a.js` is in `ignores`, then `foo/a.js` and `foo/baz/a.js` are considered ignored. | ||
- **The file is outside the `basePath`.** If the `basePath` is `/usr/me`, then `/foo/a.js` is considered ignored. | ||
@@ -317,7 +317,7 @@ For directories, use the `isDirectoryIgnored()` method and pass in the path of any directory, as in this example: | ||
- **It's parent directory is ignored.** For example, if `foo` is in `ignores`, then `foo/baz` is considered ignored. | ||
- **It has an ancestor directory that is ignored.** For example, if `foo` is in `ignores`, then `foo/bar/baz/a.js` is considered ignored. | ||
- **It matches and ignored file pattern.** For example, if `**/a.js` is in `ignores`, then `foo/a.js` and `foo/baz/a.js` are considered ignored. | ||
- **If it matches an entry in `files` and also in `ignores`.** For example, if `**/*.js` is in `files` and `**/a.js` is in `ignores`, then `foo/a.js` and `foo/baz/a.js` are considered ignored. | ||
- **The file is outside the `basePath`.** If the `basePath` is `/usr/me`, then `/foo/a.js` is considered ignored. | ||
- **It's parent directory is ignored.** For example, if `foo` is in `ignores`, then `foo/baz` is considered ignored. | ||
- **It has an ancestor directory that is ignored.** For example, if `foo` is in `ignores`, then `foo/bar/baz/a.js` is considered ignored. | ||
- **It matches and ignored file pattern.** For example, if `**/a.js` is in `ignores`, then `foo/a.js` and `foo/baz/a.js` are considered ignored. | ||
- **If it matches an entry in `files` and also in `ignores`.** For example, if `**/*.js` is in `files` and `**/a.js` is in `ignores`, then `foo/a.js` and `foo/baz/a.js` are considered ignored. | ||
- **The file is outside the `basePath`.** If the `basePath` is `/usr/me`, then `/foo/a.js` is considered ignored. | ||
@@ -337,5 +337,5 @@ **Important:** A pattern such as `foo/**` means that `foo` and `foo/` are _not_ ignored whereas `foo/bar` is ignored. If you want to ignore `foo` and all of its subdirectories, use the pattern `foo` or `foo/` in `ignores`. | ||
- Teddy Katz (@not-an-aardvark) | ||
- Toru Nagashima (@mysticatea) | ||
- Kai Cataldo (@kaicataldo) | ||
- Teddy Katz (@not-an-aardvark) | ||
- Toru Nagashima (@mysticatea) | ||
- Kai Cataldo (@kaicataldo) | ||
@@ -357,4 +357,4 @@ ## License | ||
<p><a href="https://trunk.io/"><img src="https://images.opencollective.com/trunkio/fb92d60/avatar.png" alt="trunk.io" height="96"></a></p><h3>Silver Sponsors</h3> | ||
<p><a href="https://www.jetbrains.com/"><img src="https://images.opencollective.com/jetbrains/fe76f99/logo.png" alt="JetBrains" height="64"></a> <a href="https://liftoff.io/"><img src="https://images.opencollective.com/liftoff/5c4fa84/logo.png" alt="Liftoff" height="64"></a> <a href="https://americanexpress.io"><img src="https://avatars.githubusercontent.com/u/3853301?v=4" alt="American Express" height="64"></a> <a href="https://www.workleap.com"><img src="https://avatars.githubusercontent.com/u/53535748?u=d1e55d7661d724bf2281c1bfd33cb8f99fe2465f&v=4" alt="Workleap" height="64"></a></p><h3>Bronze Sponsors</h3> | ||
<p><a href="https://www.wordhint.net/"><img src="https://images.opencollective.com/wordhint/be86813/avatar.png" alt="WordHint" height="32"></a> <a href="https://www.crosswordsolver.org/anagram-solver/"><img src="https://images.opencollective.com/anagram-solver/2666271/logo.png" alt="Anagram Solver" height="32"></a> <a href="https://icons8.com/"><img src="https://images.opencollective.com/icons8/7fa1641/logo.png" alt="Icons8" height="32"></a> <a href="https://discord.com"><img src="https://images.opencollective.com/discordapp/f9645d9/logo.png" alt="Discord" height="32"></a> <a href="https://www.gitbook.com"><img src="https://avatars.githubusercontent.com/u/7111340?v=4" alt="GitBook" height="32"></a> <a href="https://nx.dev"><img src="https://avatars.githubusercontent.com/u/23692104?v=4" alt="Nx" height="32"></a> <a href="https://herocoders.com"><img src="https://avatars.githubusercontent.com/u/37549774?v=4" alt="HeroCoders" height="32"></a></p> | ||
<p><a href="https://www.serptriumph.com/"><img src="https://images.opencollective.com/serp-triumph5/fea3074/logo.png" alt="SERP Triumph" height="64"></a> <a href="https://www.jetbrains.com/"><img src="https://images.opencollective.com/jetbrains/fe76f99/logo.png" alt="JetBrains" height="64"></a> <a href="https://liftoff.io/"><img src="https://images.opencollective.com/liftoff/5c4fa84/logo.png" alt="Liftoff" height="64"></a> <a href="https://americanexpress.io"><img src="https://avatars.githubusercontent.com/u/3853301?v=4" alt="American Express" height="64"></a> <a href="https://www.workleap.com"><img src="https://avatars.githubusercontent.com/u/53535748?u=d1e55d7661d724bf2281c1bfd33cb8f99fe2465f&v=4" alt="Workleap" height="64"></a></p><h3>Bronze Sponsors</h3> | ||
<p><a href="https://cybozu.co.jp/"><img src="https://images.opencollective.com/cybozu/933e46d/logo.png" alt="Cybozu" height="32"></a> <a href="https://www.wordhint.net/"><img src="https://images.opencollective.com/wordhint/be86813/avatar.png" alt="WordHint" height="32"></a> <a href="https://www.crosswordsolver.org/anagram-solver/"><img src="https://images.opencollective.com/anagram-solver/2666271/logo.png" alt="Anagram Solver" height="32"></a> <a href="https://icons8.com/"><img src="https://images.opencollective.com/icons8/7fa1641/logo.png" alt="Icons8" height="32"></a> <a href="https://discord.com"><img src="https://images.opencollective.com/discordapp/f9645d9/logo.png" alt="Discord" height="32"></a> <a href="https://www.gitbook.com"><img src="https://avatars.githubusercontent.com/u/7111340?v=4" alt="GitBook" height="32"></a> <a href="https://nx.dev"><img src="https://avatars.githubusercontent.com/u/23692104?v=4" alt="Nx" height="32"></a> <a href="https://opensource.mercedes-benz.com/"><img src="https://avatars.githubusercontent.com/u/34240465?v=4" alt="Mercedes-Benz Group" height="32"></a> <a href="https://herocoders.com"><img src="https://avatars.githubusercontent.com/u/37549774?v=4" alt="HeroCoders" height="32"></a></p> | ||
<h3>Technology Sponsors</h3> | ||
@@ -361,0 +361,0 @@ Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work. |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
314613
8221
0
Updated@eslint/object-schema@^2.1.5