eslint
Advanced tools
Comparing version 8.35.0 to 8.36.0
@@ -9,3 +9,3 @@ { | ||
"name": "Deprecated", | ||
"description": "These rules have been deprecated in accordance with the <a href=\"/docs/use/rule-deprecation\">deprecation policy</a>, and replaced by newer rules:", | ||
"description": "These rules have been deprecated in accordance with the <a href=\"{{ '/use/rule-deprecation' | url }}\">deprecation policy</a>, and replaced by newer rules:", | ||
"rules": [] | ||
@@ -15,3 +15,3 @@ }, | ||
"name": "Removed", | ||
"description": "These rules from older versions of ESLint (before the <a href=\"/docs/use/rule-deprecation\">deprecation policy</a> existed) have been replaced by newer rules:", | ||
"description": "These rules from older versions of ESLint (before the <a href=\"{{ '/use/rule-deprecation' | url }}\">deprecation policy</a> existed) have been replaced by newer rules:", | ||
"rules": [ | ||
@@ -18,0 +18,0 @@ { "removed": "generator-star", "replacedBy": ["generator-star-spacing"] }, |
@@ -352,3 +352,3 @@ /** | ||
if (globInputPaths && isGlobPattern(pattern)) { | ||
return this._iterateFilesWithGlob(absolutePath, isDot); | ||
return this._iterateFilesWithGlob(pattern, isDot); | ||
} | ||
@@ -402,4 +402,6 @@ | ||
const directoryPath = path.resolve(getGlobParent(pattern)); | ||
const globPart = pattern.slice(directoryPath.length + 1); | ||
const { cwd } = internalSlotsMap.get(this); | ||
const directoryPath = path.resolve(cwd, getGlobParent(pattern)); | ||
const absolutePath = path.resolve(cwd, pattern); | ||
const globPart = absolutePath.slice(directoryPath.length + 1); | ||
@@ -411,3 +413,3 @@ /* | ||
const recursive = /\*\*|\/|\\/u.test(globPart); | ||
const selector = new Minimatch(pattern, minimatchOpts); | ||
const selector = new Minimatch(absolutePath, minimatchOpts); | ||
@@ -414,0 +416,0 @@ debug(`recursive? ${recursive}`); |
@@ -39,2 +39,41 @@ /** | ||
/** | ||
* Returns the name of an object in the config by reading its `meta` key. | ||
* @param {Object} object The object to check. | ||
* @returns {string?} The name of the object if found or `null` if there | ||
* is no name. | ||
*/ | ||
function getObjectId(object) { | ||
// first check old-style name | ||
let name = object.name; | ||
if (!name) { | ||
if (!object.meta) { | ||
return null; | ||
} | ||
name = object.meta.name; | ||
if (!name) { | ||
return null; | ||
} | ||
} | ||
// now check for old-style version | ||
let version = object.version; | ||
if (!version) { | ||
version = object.meta && object.meta.version; | ||
} | ||
// if there's a version then append that | ||
if (version) { | ||
return `${name}@${version}`; | ||
} | ||
return name; | ||
} | ||
const originalBaseConfig = Symbol("originalBaseConfig"); | ||
@@ -155,7 +194,9 @@ | ||
if (languageOptions && languageOptions.parser) { | ||
if (typeof languageOptions.parser === "string") { | ||
const { pluginName, objectName: localParserName } = splitPluginIdentifier(languageOptions.parser); | ||
const { parser } = languageOptions; | ||
parserName = languageOptions.parser; | ||
if (typeof parser === "string") { | ||
const { pluginName, objectName: localParserName } = splitPluginIdentifier(parser); | ||
parserName = parser; | ||
if (!plugins || !plugins[pluginName] || !plugins[pluginName].parsers || !plugins[pluginName].parsers[localParserName]) { | ||
@@ -166,2 +207,9 @@ throw new TypeError(`Key "parser": Could not find "${localParserName}" in plugin "${pluginName}".`); | ||
languageOptions.parser = plugins[pluginName].parsers[localParserName]; | ||
} else if (typeof parser === "object") { | ||
parserName = getObjectId(parser); | ||
if (!parserName) { | ||
invalidParser = true; | ||
} | ||
} else { | ||
@@ -184,2 +232,9 @@ invalidParser = true; | ||
config.processor = plugins[pluginName].processors[localProcessorName]; | ||
} else if (typeof processor === "object") { | ||
processorName = getObjectId(processor); | ||
if (!processorName) { | ||
invalidProcessor = true; | ||
} | ||
} else { | ||
@@ -198,7 +253,7 @@ invalidProcessor = true; | ||
if (invalidParser) { | ||
throw new Error("Caching is not supported when parser is an object."); | ||
throw new Error("Could not serialize parser object (missing 'meta' object)."); | ||
} | ||
if (invalidProcessor) { | ||
throw new Error("Caching is not supported when processor is an object."); | ||
throw new Error("Could not serialize processor object (missing 'meta' object)."); | ||
} | ||
@@ -205,0 +260,0 @@ |
@@ -529,5 +529,5 @@ /** | ||
// save patterns for later use based on whether globs are enabled | ||
if (globInputPaths && isGlobPattern(filePath)) { | ||
if (globInputPaths && isGlobPattern(pattern)) { | ||
const basePath = globParent(filePath); | ||
const basePath = path.resolve(cwd, globParent(pattern)); | ||
@@ -534,0 +534,0 @@ // group in cwd if possible and split out others |
@@ -25,3 +25,33 @@ /** | ||
fixable: "whitespace", | ||
schema: [{ enum: ["starred-block", "separate-lines", "bare-block"] }], | ||
schema: { | ||
anyOf: [ | ||
{ | ||
type: "array", | ||
items: [ | ||
{ | ||
enum: ["starred-block", "bare-block"] | ||
} | ||
], | ||
additionalItems: false | ||
}, | ||
{ | ||
type: "array", | ||
items: [ | ||
{ | ||
enum: ["separate-lines"] | ||
}, | ||
{ | ||
type: "object", | ||
properties: { | ||
checkJSDoc: { | ||
type: "boolean" | ||
} | ||
}, | ||
additionalProperties: false | ||
} | ||
], | ||
additionalItems: false | ||
} | ||
] | ||
}, | ||
messages: { | ||
@@ -41,2 +71,4 @@ expectedBlock: "Expected a block comment instead of consecutive line comments.", | ||
const option = context.options[0] || "starred-block"; | ||
const params = context.options[1] || {}; | ||
const checkJSDoc = !!params.checkJSDoc; | ||
@@ -338,7 +370,14 @@ //---------------------------------------------------------------------- | ||
if (firstComment.type !== "Block" || isJSDocComment(commentGroup)) { | ||
const isJSDoc = isJSDocComment(commentGroup); | ||
if (firstComment.type !== "Block" || (!checkJSDoc && isJSDoc)) { | ||
return; | ||
} | ||
const commentLines = getCommentLines(commentGroup); | ||
let commentLines = getCommentLines(commentGroup); | ||
if (isJSDoc) { | ||
commentLines = commentLines.slice(1, commentLines.length - 1); | ||
} | ||
const tokenAfter = sourceCode.getTokenAfter(firstComment, { includeComments: true }); | ||
@@ -345,0 +384,0 @@ |
@@ -8,3 +8,3 @@ /** | ||
const RegExpValidator = require("regexpp").RegExpValidator; | ||
const RegExpValidator = require("@eslint-community/regexpp").RegExpValidator; | ||
const collector = new (class { | ||
@@ -11,0 +11,0 @@ constructor() { |
@@ -13,3 +13,3 @@ /** | ||
const astUtils = require("./utils/ast-utils"); | ||
const eslintUtils = require("eslint-utils"); | ||
const eslintUtils = require("@eslint-community/eslint-utils"); | ||
@@ -16,0 +16,0 @@ const precedence = astUtils.getPrecedence; |
@@ -11,3 +11,3 @@ /** | ||
const { isParenthesized: isParenthesizedRaw } = require("eslint-utils"); | ||
const { isParenthesized: isParenthesizedRaw } = require("@eslint-community/eslint-utils"); | ||
const astUtils = require("./utils/ast-utils.js"); | ||
@@ -14,0 +14,0 @@ |
@@ -13,3 +13,3 @@ /** | ||
const astUtils = require("./utils/ast-utils"); | ||
const { getStaticValue } = require("eslint-utils"); | ||
const { getStaticValue } = require("@eslint-community/eslint-utils"); | ||
@@ -16,0 +16,0 @@ //------------------------------------------------------------------------------ |
@@ -12,3 +12,3 @@ /** | ||
const { findVariable } = require("eslint-utils"); | ||
const { findVariable } = require("@eslint-community/eslint-utils"); | ||
const astUtils = require("./utils/ast-utils"); | ||
@@ -15,0 +15,0 @@ |
@@ -11,3 +11,3 @@ /** | ||
const RegExpValidator = require("regexpp").RegExpValidator; | ||
const RegExpValidator = require("@eslint-community/regexpp").RegExpValidator; | ||
const validator = new RegExpValidator(); | ||
@@ -14,0 +14,0 @@ const validFlags = /[dgimsuy]/gu; |
@@ -6,4 +6,4 @@ /** | ||
const { CALL, CONSTRUCT, ReferenceTracker, getStringIfConstant } = require("eslint-utils"); | ||
const { RegExpValidator, RegExpParser, visitRegExpAST } = require("regexpp"); | ||
const { CALL, CONSTRUCT, ReferenceTracker, getStringIfConstant } = require("@eslint-community/eslint-utils"); | ||
const { RegExpValidator, RegExpParser, visitRegExpAST } = require("@eslint-community/regexpp"); | ||
const { isCombiningCharacter, isEmojiModifier, isRegionalIndicatorSymbol, isSurrogatePair } = require("./utils/unicode"); | ||
@@ -10,0 +10,0 @@ const astUtils = require("./utils/ast-utils.js"); |
@@ -12,3 +12,3 @@ /** | ||
const { CALL, CONSTRUCT, ReferenceTracker } = require("eslint-utils"); | ||
const { CALL, CONSTRUCT, ReferenceTracker } = require("@eslint-community/eslint-utils"); | ||
const getPropertyName = require("./utils/ast-utils").getStaticPropertyName; | ||
@@ -15,0 +15,0 @@ |
@@ -12,3 +12,3 @@ /** | ||
const { findVariable } = require("eslint-utils"); | ||
const { findVariable } = require("@eslint-community/eslint-utils"); | ||
@@ -15,0 +15,0 @@ //------------------------------------------------------------------------------ |
@@ -13,3 +13,3 @@ /** | ||
const astUtils = require("./utils/ast-utils"); | ||
const regexpp = require("regexpp"); | ||
const regexpp = require("@eslint-community/regexpp"); | ||
@@ -16,0 +16,0 @@ //------------------------------------------------------------------------------ |
@@ -13,3 +13,3 @@ /** | ||
const astUtils = require("./utils/ast-utils"); | ||
const { findVariable } = require("eslint-utils"); | ||
const { findVariable } = require("@eslint-community/eslint-utils"); | ||
@@ -16,0 +16,0 @@ //------------------------------------------------------------------------------ |
@@ -12,4 +12,4 @@ /** | ||
const { CALL, CONSTRUCT, ReferenceTracker, getStringIfConstant } = require("eslint-utils"); | ||
const { RegExpParser, visitRegExpAST } = require("regexpp"); | ||
const { CALL, CONSTRUCT, ReferenceTracker, getStringIfConstant } = require("@eslint-community/eslint-utils"); | ||
const { RegExpParser, visitRegExpAST } = require("@eslint-community/regexpp"); | ||
@@ -16,0 +16,0 @@ //------------------------------------------------------------------------------ |
@@ -13,3 +13,3 @@ /** | ||
const astUtils = require("./utils/ast-utils"); | ||
const { CALL, ReferenceTracker } = require("eslint-utils"); | ||
const { CALL, ReferenceTracker } = require("@eslint-community/eslint-utils"); | ||
@@ -16,0 +16,0 @@ //------------------------------------------------------------------------------ |
@@ -17,4 +17,4 @@ /** | ||
getStringIfConstant | ||
} = require("eslint-utils"); | ||
const regexpp = require("regexpp"); | ||
} = require("@eslint-community/eslint-utils"); | ||
const regexpp = require("@eslint-community/regexpp"); | ||
@@ -21,0 +21,0 @@ //------------------------------------------------------------------------------ |
@@ -9,3 +9,3 @@ /** | ||
const { CALL, ReferenceTracker } = require("eslint-utils"); | ||
const { CALL, ReferenceTracker } = require("@eslint-community/eslint-utils"); | ||
const { | ||
@@ -12,0 +12,0 @@ isCommaToken, |
@@ -13,4 +13,4 @@ /** | ||
const astUtils = require("./utils/ast-utils"); | ||
const { CALL, CONSTRUCT, ReferenceTracker, findVariable } = require("eslint-utils"); | ||
const { RegExpValidator, visitRegExpAST, RegExpParser } = require("regexpp"); | ||
const { CALL, CONSTRUCT, ReferenceTracker, findVariable } = require("@eslint-community/eslint-utils"); | ||
const { RegExpValidator, visitRegExpAST, RegExpParser } = require("@eslint-community/regexpp"); | ||
const { canTokensBeAdjacent } = require("./utils/ast-utils"); | ||
@@ -17,0 +17,0 @@ |
@@ -17,3 +17,3 @@ /** | ||
getStringIfConstant | ||
} = require("eslint-utils"); | ||
} = require("@eslint-community/eslint-utils"); | ||
@@ -20,0 +20,0 @@ //------------------------------------------------------------------------------ |
@@ -13,3 +13,3 @@ /** | ||
const astUtils = require("./utils/ast-utils"); | ||
const eslintUtils = require("eslint-utils"); | ||
const eslintUtils = require("@eslint-community/eslint-utils"); | ||
@@ -16,0 +16,0 @@ //---------------------------------------------------------------------- |
@@ -12,3 +12,3 @@ /** | ||
const | ||
{ isCommentToken } = require("eslint-utils"), | ||
{ isCommentToken } = require("@eslint-community/eslint-utils"), | ||
TokenStore = require("./token-store"), | ||
@@ -15,0 +15,0 @@ astUtils = require("../shared/ast-utils"), |
@@ -12,3 +12,3 @@ /** | ||
const assert = require("assert"); | ||
const { isCommentToken } = require("eslint-utils"); | ||
const { isCommentToken } = require("@eslint-community/eslint-utils"); | ||
const cursors = require("./cursors"); | ||
@@ -15,0 +15,0 @@ const ForwardTokenCursor = require("./forward-token-cursor"); |
{ | ||
"name": "eslint", | ||
"version": "8.35.0", | ||
"version": "8.36.0", | ||
"author": "Nicholas C. Zakas <nicholas+npm@nczconsulting.com>", | ||
@@ -63,4 +63,6 @@ "description": "An AST-based pattern checker for JavaScript.", | ||
"dependencies": { | ||
"@eslint/eslintrc": "^2.0.0", | ||
"@eslint/js": "8.35.0", | ||
"@eslint-community/eslint-utils": "^4.2.0", | ||
"@eslint-community/regexpp": "^4.4.0", | ||
"@eslint/eslintrc": "^2.0.1", | ||
"@eslint/js": "8.36.0", | ||
"@humanwhocodes/config-array": "^0.11.8", | ||
@@ -76,5 +78,4 @@ "@humanwhocodes/module-importer": "^1.0.1", | ||
"eslint-scope": "^7.1.1", | ||
"eslint-utils": "^3.0.0", | ||
"eslint-visitor-keys": "^3.3.0", | ||
"espree": "^9.4.0", | ||
"espree": "^9.5.0", | ||
"esquery": "^1.4.2", | ||
@@ -101,3 +102,2 @@ "esutils": "^2.0.2", | ||
"optionator": "^0.9.1", | ||
"regexpp": "^3.2.0", | ||
"strip-ansi": "^6.0.1", | ||
@@ -104,0 +104,0 @@ "strip-json-comments": "^3.1.0", |
@@ -215,7 +215,2 @@ [![npm version](https://img.shields.io/npm/v/eslint.svg)](https://www.npmjs.com/package/eslint) | ||
</td><td align="center" valign="top" width="11%"> | ||
<a href="https://github.com/btmills"> | ||
<img src="https://github.com/btmills.png?s=75" width="75" height="75"><br /> | ||
Brandon Mills | ||
</a> | ||
</td><td align="center" valign="top" width="11%"> | ||
<a href="https://github.com/mdjermanovic"> | ||
@@ -253,5 +248,5 @@ <img src="https://github.com/mdjermanovic.png?s=75" width="75" height="75"><br /> | ||
</td><td align="center" valign="top" width="11%"> | ||
<a href="https://github.com/SaraSoueidan"> | ||
<img src="https://github.com/SaraSoueidan.png?s=75" width="75" height="75"><br /> | ||
Sara Soueidan | ||
<a href="https://github.com/btmills"> | ||
<img src="https://github.com/btmills.png?s=75" width="75" height="75"><br /> | ||
Brandon Mills | ||
</a> | ||
@@ -302,3 +297,3 @@ </td><td align="center" valign="top" width="11%"> | ||
<p><a href="https://ridicorp.com/career/"><img src="https://images.opencollective.com/ridi-corporation/175dcf3/logo.png" alt="RIDI" height="96"></a> <a href="https://engineering.salesforce.com"><img src="https://images.opencollective.com/salesforce/ca8f997/logo.png" alt="Salesforce" height="96"></a> <a href="https://www.airbnb.com/"><img src="https://images.opencollective.com/airbnb/d327d66/logo.png" alt="Airbnb" height="96"></a></p><h3>Silver Sponsors</h3> | ||
<p><a href="https://sentry.io"><img src="https://avatars.githubusercontent.com/u/1396951?v=4" alt="Sentry" height="64"></a> <a href="https://liftoff.io/"><img src="https://images.opencollective.com/liftoff/5c4fa84/logo.png" alt="Liftoff" height="64"></a></p><h3>Bronze Sponsors</h3> | ||
<p><a href="https://sentry.io"><img src="https://avatars.githubusercontent.com/u/1396951?v=4" alt="Sentry" 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></p><h3>Bronze Sponsors</h3> | ||
<p><a href="https://paydaysay.com/"><img src="https://images.opencollective.com/payday-say-organization/9cd2467/logo.png" alt="PayDay Say" height="32"></a> <a href="https://themeisle.com"><img src="https://images.opencollective.com/themeisle/d5592fe/logo.png" alt="ThemeIsle" height="32"></a> <a href="https://nx.dev"><img src="https://images.opencollective.com/nx/0efbe42/logo.png" alt="Nx (by Nrwl)" 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: free icons, photos, illustrations, and music" 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://transloadit.com/"><img src="https://avatars.githubusercontent.com/u/125754?v=4" alt="Transloadit" height="32"></a> <a href="https://www.ignitionapp.com"><img src="https://avatars.githubusercontent.com/u/5753491?v=4" alt="Ignition" height="32"></a> <a href="https://herocoders.com"><img src="https://avatars.githubusercontent.com/u/37549774?v=4" alt="HeroCoders" height="32"></a> <a href="https://quickbookstoolhub.com"><img src="https://avatars.githubusercontent.com/u/95090305?u=e5bc398ef775c9ed19f955c675cdc1fb6abf01df&v=4" alt="QuickBooks Tool hub" height="32"></a></p> | ||
@@ -305,0 +300,0 @@ <!--sponsorsend--> |
2869269
67978
304
+ Added@eslint-community/eslint-utils@4.4.0(transitive)
+ Added@eslint-community/regexpp@4.10.0(transitive)
+ Added@eslint/js@8.36.0(transitive)
- Removedeslint-utils@^3.0.0
- Removedregexpp@^3.2.0
- Removed@eslint/js@8.35.0(transitive)
- Removedeslint-utils@3.0.0(transitive)
- Removedeslint-visitor-keys@2.1.0(transitive)
- Removedregexpp@3.2.0(transitive)
Updated@eslint/eslintrc@^2.0.1
Updated@eslint/js@8.36.0
Updatedespree@^9.5.0