From f96a1af17a5a01060209136a6ba8c625faeb2c46 Mon Sep 17 00:00:00 2001 From: Brett Zamir Date: Mon, 30 Oct 2023 07:07:27 -0700 Subject: [PATCH] chore: update devDep. and lint --- package.json | 2 +- pnpm-lock.yaml | 15 +++++---------- src/exportParser.js | 3 --- src/iterateJsdoc.js | 15 --------------- src/jsdocUtils.js | 3 --- src/rules/checkTypes.js | 1 - src/rules/requireHyphenBeforeParamDescription.js | 1 - src/rules/requireJsdoc.js | 6 ------ src/rules/validTypes.js | 1 - 9 files changed, 6 insertions(+), 41 deletions(-) diff --git a/package.json b/package.json index 00125958d..a382159cf 100644 --- a/package.json +++ b/package.json @@ -50,7 +50,7 @@ "cross-env": "^7.0.3", "decamelize": "^5.0.1", "eslint": "8.52.0", - "eslint-config-canonical": "~42.1.0", + "eslint-config-canonical": "~42.3.0", "espree": "^9.6.1", "gitdown": "^3.1.5", "glob": "^10.3.10", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 77fe07017..99112bf7b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -134,8 +134,8 @@ devDependencies: specifier: 8.52.0 version: 8.52.0 eslint-config-canonical: - specifier: ~42.1.0 - version: 42.1.0(@babel/plugin-syntax-flow@7.22.5)(@babel/plugin-transform-react-jsx@7.22.5)(@types/eslint@8.44.6)(@types/node@20.8.9)(eslint@8.52.0)(graphql@16.7.1)(typescript@5.2.2)(vitest@0.34.1) + specifier: ~42.3.0 + version: 42.3.0(@babel/plugin-syntax-flow@7.22.5)(@babel/plugin-transform-react-jsx@7.22.5)(@types/eslint@8.44.6)(@types/node@20.8.9)(eslint@8.52.0)(graphql@16.7.1)(typescript@5.2.2)(vitest@0.34.1) espree: specifier: ^9.6.1 version: 9.6.1 @@ -4792,8 +4792,8 @@ packages: eslint: 8.52.0 dev: true - /eslint-config-canonical@42.1.0(@babel/plugin-syntax-flow@7.22.5)(@babel/plugin-transform-react-jsx@7.22.5)(@types/eslint@8.44.6)(@types/node@20.8.9)(eslint@8.52.0)(graphql@16.7.1)(typescript@5.2.2)(vitest@0.34.1): - resolution: {integrity: sha512-h1h+Z4t/iy4mJfGud9s7jsVg/JBsAgIIYKgcrdODzJ45MU6Drs0aZ5efkY47y2e86CLusbZArf9ZQJcsLeI30g==} + /eslint-config-canonical@42.3.0(@babel/plugin-syntax-flow@7.22.5)(@babel/plugin-transform-react-jsx@7.22.5)(@types/eslint@8.44.6)(@types/node@20.8.9)(eslint@8.52.0)(graphql@16.7.1)(typescript@5.2.2)(vitest@0.34.1): + resolution: {integrity: sha512-1FDYIBs3gFpZNhCAe4zfskCsYQNrBc15npCVrFqI2fknszMgoEi7YoYlzx18eSPnlH3xigQWm0ZK90351yZI+Q==} engines: {node: '>=16.0.0'} peerDependencies: eslint: ^8.30.0 @@ -10898,12 +10898,7 @@ packages: dependencies: eslint-visitor-keys: 3.4.3 lodash: 4.17.21 - yaml: 2.3.2 - dev: true - - /yaml@2.3.2: - resolution: {integrity: sha512-N/lyzTPaJasoDmfV7YTrYCI0G/3ivm/9wdG0aHuheKowWQwGTsK0Eoiw6utmzAnI6pkJa0DUVygvp3spqqEKXg==} - engines: {node: '>= 14'} + yaml: 2.3.3 dev: true /yaml@2.3.3: diff --git a/src/exportParser.js b/src/exportParser.js index 842effc45..9ec8e089d 100644 --- a/src/exportParser.js +++ b/src/exportParser.js @@ -123,7 +123,6 @@ const getSymbol = function (node, globals, scope, opt) { /* eslint-enable complexity -- Temporary */ const opts = opt || {}; /* istanbul ignore next */ - // eslint-disable-next-line default-case switch (node.type) { case 'Identifier': { return getIdentifier(node, globals, scope, opts); @@ -318,7 +317,6 @@ createSymbol = function (node, globals, value, scope, isGlobal) { } let symbol; - // eslint-disable-next-line default-case switch (node.type) { case 'FunctionDeclaration': /* istanbul ignore next */ @@ -411,7 +409,6 @@ createSymbol = function (node, globals, value, scope, isGlobal) { * @returns {void} */ const initVariables = function (node, globals, opts) { - // eslint-disable-next-line default-case switch (node.type) { case 'Program': { for (const childNode of node.body) { diff --git a/src/iterateJsdoc.js b/src/iterateJsdoc.js index 82b1358ad..0dbee3cbd 100644 --- a/src/iterateJsdoc.js +++ b/src/iterateJsdoc.js @@ -122,7 +122,6 @@ import esquery from 'esquery'; * [key: string]: string * }} [data] */ -/* eslint-enable jsdoc/valid-types -- Old version */ /** * @callback GetRegexFromString @@ -170,7 +169,6 @@ import esquery from 'esquery'; * ) => import('comment-parser').Line[]} setter * @returns {void} */ -/* eslint-enable jsdoc/no-undefined-types -- Bug */ /** * @callback SetDescriptionLines @@ -185,7 +183,6 @@ import esquery from 'esquery'; * @param {...Partial} tokens * @returns {void} */ -/* eslint-enable jsdoc/no-undefined-types -- TS */ /** * @callback SetTag @@ -195,7 +192,6 @@ import esquery from 'esquery'; * @param {Partial} [tokens] * @returns {void} */ -/* eslint-enable jsdoc/no-undefined-types -- TS */ /** * @callback RemoveTag @@ -225,7 +221,6 @@ import esquery from 'esquery'; * tokens?: Partial | undefined * ) => import('comment-parser').Tokens} SeedTokens */ -/* eslint-enable jsdoc/no-undefined-types -- TS */ /** * Sets tokens to empty string. @@ -240,7 +235,6 @@ import esquery from 'esquery'; * @param {Partial} tokens * @returns {void} */ -/* eslint-enable jsdoc/no-undefined-types -- TS */ /** * @callback AddLines @@ -576,7 +570,6 @@ const { * } * }} StateObject */ -/* eslint-enable jsdoc/valid-types -- Old version */ /** * The Node AST as supplied by the parser. @@ -668,7 +661,6 @@ const getBasicUtils = (context, { * }} [data] * @returns {void} */ -/* eslint-enable jsdoc/valid-types -- Old version of pratt */ /** * @param {Node|null} node @@ -1807,7 +1799,6 @@ const getUtils = ( * contexts?: Context[] * }} Settings */ -/* eslint-enable jsdoc/valid-types -- Old version */ /** * @param {import('eslint').Rule.RuleContext} context @@ -1885,7 +1876,6 @@ const getSettings = (context) => { const makeReport = (context, commentNode) => { /** @type {Report} */ const report = (message, fix = null, jsdocLoc = null, data = undefined) => { - /* eslint-enable jsdoc/valid-types -- Old version */ let loc; if (jsdocLoc) { @@ -1985,8 +1975,6 @@ const makeReport = (context, commentNode) => { * } * ) => any } JsdocVisitor */ -/* eslint-enable jsdoc/valid-types -- Old version */ -/* eslint-enable jsdoc/no-undefined-types -- canonical still using an older version where not defined */ /** * @param {{ @@ -2439,7 +2427,6 @@ export default function iterateJsdoc (iterator, ruleConfig) { * @type {Context[]|undefined} */ let contexts; - /* eslint-enable jsdoc/valid-types -- Old version */ if (ruleConfig.contextDefaults || ruleConfig.contextSelected || ruleConfig.matchContext) { contexts = ruleConfig.matchContext && context.options[0]?.match ? context.options[0].match : @@ -2486,7 +2473,6 @@ export default function iterateJsdoc (iterator, ruleConfig) { /** @type {Partial} */ const state = {}; - /* eslint-enable jsdoc/no-undefined-types -- TS */ /** @type {CheckJsdoc} */ const checkJsdoc = (info, handler, node) => { @@ -2563,7 +2549,6 @@ export default function iterateJsdoc (iterator, ruleConfig) { settings, state: ste, }); - /* eslint-enable jsdoc/no-undefined-types -- Bug */ }; } diff --git a/src/jsdocUtils.js b/src/jsdocUtils.js index 9d3f5b4cc..8e6c015d9 100644 --- a/src/jsdocUtils.js +++ b/src/jsdocUtils.js @@ -307,7 +307,6 @@ const getFunctionParameterNames = ( } if (param.type === 'Property') { - // eslint-disable-next-line default-case switch (param.value.type) { case 'ArrayPattern': { return [ @@ -336,7 +335,6 @@ const getFunctionParameterNames = ( } case 'AssignmentPattern': { - // eslint-disable-next-line default-case switch (param.value.left.type) { case 'Identifier': // Default parameter @@ -1416,7 +1414,6 @@ const tagsWithNamesAndDescriptions = new Set([ * {message: string, replacement?: string} * }} TagNamePreference */ -/* eslint-enable jsdoc/valid-types -- Old version */ /** * @param {import('eslint').Rule.RuleContext} context diff --git a/src/rules/checkTypes.js b/src/rules/checkTypes.js index a9f81a14a..c295db887 100644 --- a/src/rules/checkTypes.js +++ b/src/rules/checkTypes.js @@ -113,7 +113,6 @@ export default iterateJsdoc(({ structuredTags, mode, } = settings; - /* eslint-enable jsdoc/valid-types -- Old version */ const injectObjectPreferredTypes = !('Object' in preferredTypesOriginal || 'object' in preferredTypesOriginal || diff --git a/src/rules/requireHyphenBeforeParamDescription.js b/src/rules/requireHyphenBeforeParamDescription.js index 5d881f7ed..791e842fa 100644 --- a/src/rules/requireHyphenBeforeParamDescription.js +++ b/src/rules/requireHyphenBeforeParamDescription.js @@ -18,7 +18,6 @@ export default iterateJsdoc(({ const tgs = /** * @type {null|"any"|{[key: string]: "always"|"never"}} */ (tags); - /* eslint-enable jsdoc/valid-types -- Old version */ /** * @param {import('@es-joy/jsdoccomment').JsdocTagWithInline} jsdocTag diff --git a/src/rules/requireJsdoc.js b/src/rules/requireJsdoc.js index 9ed84b96d..fb74c0e1c 100644 --- a/src/rules/requireJsdoc.js +++ b/src/rules/requireJsdoc.js @@ -180,7 +180,6 @@ const getOption = (context, baseObject, option, key) => { return /** @type {{[key: string]: {default?: boolean|undefined}}} */ ( baseObject.properties )[key].default; - /* eslint-enable jsdoc/valid-types -- Old version */ }; /** @@ -202,7 +201,6 @@ const getOption = (context, baseObject, option, key) => { * }} */ const getOptions = (context, settings) => { - /* eslint-enable jsdoc/valid-types -- Old version */ const { publicOnly, contexts = settings.contexts || [], @@ -227,7 +225,6 @@ const getOptions = (context, settings) => { /** @type {{[key: string]: boolean|undefined}} */ const properties = {}; - /* eslint-enable jsdoc/valid-types -- Old version */ for (const prop of Object.keys( /** @type {import('json-schema').JSONSchema4Object} */ ( /** @type {import('json-schema').JSONSchema4Object} */ ( @@ -260,7 +257,6 @@ const getOptions = (context, settings) => { require: ((baseObj) => { /** @type {{[key: string]: boolean|undefined}} */ const properties = {}; - /* eslint-enable jsdoc/valid-types -- Old version */ for (const prop of Object.keys( /** @type {import('json-schema').JSONSchema4Object} */ ( /** @type {import('json-schema').JSONSchema4Object} */ ( @@ -318,7 +314,6 @@ export default { */ ( opts.publicOnly ); - /* eslint-enable jsdoc/valid-types -- Old version */ /** * @type {import('../iterateJsdoc.js').CheckJsdoc} @@ -501,7 +496,6 @@ export default { report(); } }; - /* eslint-enable complexity -- Temporary */ /** * @param {string} prop diff --git a/src/rules/validTypes.js b/src/rules/validTypes.js index 339247ef7..f8620da42 100644 --- a/src/rules/validTypes.js +++ b/src/rules/validTypes.js @@ -114,7 +114,6 @@ export default iterateJsdoc(({ let handled = false; if (tagName) { - // eslint-disable-next-line default-case switch (tagName) { case 'requires': case 'module': {