From 65bd3d5a06687bbe49d3382a0d612fbc61b8ec12 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Sun, 21 Feb 2021 13:41:55 +0000 Subject: [PATCH 1/2] Update dependency @ota-meshi/eslint-plugin to ^0.0.14 --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4b110e84..a9c962e1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2588,9 +2588,9 @@ } }, "@ota-meshi/eslint-plugin": { - "version": "0.0.12", - "resolved": "https://registry.npmjs.org/@ota-meshi/eslint-plugin/-/eslint-plugin-0.0.12.tgz", - "integrity": "sha512-KiQfDS0v2vSbbkDM318AZsyZqeutrf203Nd/oselIt83g3BohtiYKscDWQzZWYTSu5J0FzMvYcekkmHoYre2RQ==", + "version": "0.0.14", + "resolved": "https://registry.npmjs.org/@ota-meshi/eslint-plugin/-/eslint-plugin-0.0.14.tgz", + "integrity": "sha512-5IeWf5xj6bAEqnWGZ4/oFvQ4rXCujMPqgVCWVTdw1n8iZTW+Hg2LWCwm3uSwtJ8AfEGnIZpxf2VX0SQiGe1pJg==", "dev": true }, "@sindresorhus/is": { diff --git a/package.json b/package.json index 3a54a320..dddcf276 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ "dist" ], "devDependencies": { - "@ota-meshi/eslint-plugin": "^0.0.12", + "@ota-meshi/eslint-plugin": "^0.0.14", "@types/eslint": "^7.2.0", "@types/eslint-visitor-keys": "^1.0.0", "@types/estree": "^0.0.46", From cb9a445c938b7d3bc2eb8cc60c2453c2770784fd Mon Sep 17 00:00:00 2001 From: yosuke ota Date: Sun, 21 Feb 2021 23:48:51 +0900 Subject: [PATCH 2/2] update --- .eslintignore | 8 +- .eslintrc.js | 3 +- .vscode/settings.json | 68 ++--- eslint-internal-rules/package.json | 8 +- .../require-meta-docs-url.js | 22 +- package-lock.json | 101 ++++++++ package.json | 234 +++++++++--------- renovate.json | 22 +- tools/lib/load-configs.ts | 1 + tools/render-rules.ts | 8 +- tools/update-docs.ts | 14 +- tsconfig.build.json | 12 +- tsconfig.json | 119 +++++---- typings/babel-eslint/index.d.ts | 4 +- typings/eslint-scope/index.d.ts | 7 +- typings/eslint-utils/index.d.ts | 10 +- 16 files changed, 377 insertions(+), 264 deletions(-) diff --git a/.eslintignore b/.eslintignore index 84c6145e..4b6fc245 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,6 +1,12 @@ /.nyc_output /coverage +/dist /node_modules /assets -/dist /docs/.vuepress/dist +/fixtures +/tests/lib/styles/fixtures +/package-lock.json +!/.github +!/.vscode +!/docs/.vuepress diff --git a/.eslintrc.js b/.eslintrc.js index 8b7a60d7..8e2daecd 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -13,8 +13,9 @@ module.exports = { "plugin:@ota-meshi/+node", "plugin:@ota-meshi/+typescript", "plugin:@ota-meshi/+eslint-plugin", - "plugin:@ota-meshi/+prettier", "plugin:@ota-meshi/+json", + "plugin:@ota-meshi/+yaml", + "plugin:@ota-meshi/+prettier", ], rules: { "require-jsdoc": "error", diff --git a/.vscode/settings.json b/.vscode/settings.json index b68bb822..5ee6fc98 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,35 +1,35 @@ { - "eslint.validate": [ - "javascript", - "javascriptreact", - "vue", - "typescript" - ], - "typescript.validate.enable": true, - "javascript.validate.enable": false, - "eslint.workingDirectories": [ - "./", "./docs/.vuepress" - ], - "vetur.validation.script": false, - "vetur.validation.style": false, - "css.validate": false, - "typescript.tsdk": "node_modules/typescript/lib", - "editor.codeActionsOnSave": { - "source.fixAll.eslint": true, - "source.fixAll.stylelint": true, - }, - "editor.codeActionsOnSaveTimeout": 7500, - "stylelint.customSyntax": "stylelint-plugin-stylus/custom-syntax", - "stylelint.validate": [ - "css", - "html", - "less", - "postcss", - "sass", - "scss", - "vue", - "vue-html", - "vue-postcss", - "stylus" - ] -} \ No newline at end of file + "eslint.validate": [ + "javascript", + "javascriptreact", + "vue", + "typescript", + "json", + "jsonc", + "yaml" + ], + "typescript.validate.enable": true, + "javascript.validate.enable": false, + "vetur.validation.script": false, + "vetur.validation.style": false, + "css.validate": false, + "typescript.tsdk": "node_modules/typescript/lib", + "editor.codeActionsOnSave": { + "source.fixAll.eslint": true, + "source.fixAll.stylelint": true + }, + "editor.codeActionsOnSaveTimeout": 7500, + "stylelint.customSyntax": "stylelint-plugin-stylus/custom-syntax", + "stylelint.validate": [ + "css", + "html", + "less", + "postcss", + "sass", + "scss", + "vue", + "vue-html", + "vue-postcss", + "stylus" + ] +} diff --git a/eslint-internal-rules/package.json b/eslint-internal-rules/package.json index 704cff5f..b4dbffdc 100644 --- a/eslint-internal-rules/package.json +++ b/eslint-internal-rules/package.json @@ -1,6 +1,6 @@ { - "name": "eslint-plugin-internal-rules", - "version": "0.2.0", - "private": true, - "main": "index.js" + "name": "eslint-plugin-internal-rules", + "version": "0.2.0", + "private": true, + "main": "index.js" } diff --git a/eslint-internal-rules/require-meta-docs-url.js b/eslint-internal-rules/require-meta-docs-url.js index e82ced2c..2054e7b5 100644 --- a/eslint-internal-rules/require-meta-docs-url.js +++ b/eslint-internal-rules/require-meta-docs-url.js @@ -5,7 +5,7 @@ // ----------------------------------------------------------------------------- const path = require("path") -// eslint-disable-next-line @mysticatea/node/no-extraneous-require +// eslint-disable-next-line node/no-extraneous-require -- ignore const util = require("eslint-plugin-eslint-plugin/lib/utils") // ----------------------------------------------------------------------------- @@ -58,7 +58,7 @@ module.exports = { node && node.type === "Literal" && typeof node.value === "string" && - (expectedUrl === undefined || node.value === expectedUrl) + (expectedUrl === undefined || node.value === expectedUrl), ) } @@ -75,9 +75,9 @@ module.exports = { } return fixer.insertTextAfter( sourceCode.getLastToken( - node.properties[node.properties.length - 1] + node.properties[node.properties.length - 1], ), - `,\n${propertyText}` + `,\n${propertyText}`, ) } @@ -93,17 +93,17 @@ module.exports = { metaNode && metaNode.properties && metaNode.properties.find( - p => + (p) => p.type === "Property" && - util.getKeyName(p) === "docs" + util.getKeyName(p) === "docs", ) const urlPropNode = docsPropNode && docsPropNode.value.properties && docsPropNode.value.properties.find( - p => + (p) => p.type === "Property" && - util.getKeyName(p) === "url" + util.getKeyName(p) === "url", ) if (isExpectedUrl(urlPropNode && urlPropNode.value)) { @@ -133,7 +133,7 @@ module.exports = { if (urlPropNode) { return fixer.replaceText( urlPropNode.value, - urlString + urlString, ) } if ( @@ -143,7 +143,7 @@ module.exports = { return insertProperty( fixer, docsPropNode.value, - `url: ${urlString}` + `url: ${urlString}`, ) } if ( @@ -154,7 +154,7 @@ module.exports = { return insertProperty( fixer, metaNode, - `docs: {\nurl: ${urlString}\n}` + `docs: {\nurl: ${urlString}\n}`, ) } } diff --git a/package-lock.json b/package-lock.json index a9c962e1..62c7fa30 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4,6 +4,12 @@ "lockfileVersion": 1, "requires": true, "dependencies": { + "@actions/core": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.2.6.tgz", + "integrity": "sha512-ZQYitnqiyBc3D+k7LsgSBmMDVkOVidaagDG7j3fOym77jNunWRuYx7VSHa9GNfFZh+zh61xsCjRj4JxMZlDqTA==", + "dev": true + }, "@babel/code-frame": { "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.4.tgz", @@ -8007,6 +8013,53 @@ "version": "file:eslint-internal-rules", "dev": true }, + "eslint-plugin-json-schema-validator": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-json-schema-validator/-/eslint-plugin-json-schema-validator-0.3.0.tgz", + "integrity": "sha512-xtR4vssse6nwopeK4j9sscIJe1Shztr2/v9tqRRkQZqTJH2rFxruUXcUW0UmikLmnO1S0c9K2Ah7UD/XPw3AGQ==", + "dev": true, + "requires": { + "@actions/core": "^1.2.6", + "ajv": "^7.0.0", + "debug": "^4.3.1", + "eslint-utils": "^2.1.0", + "jsonc-eslint-parser": "^0.6.2", + "lodash": "^4.17.19", + "minimatch": "^3.0.4", + "toml-eslint-parser": "^0.2.1", + "tunnel-agent": "^0.6.0", + "yaml-eslint-parser": "^0.3.2" + }, + "dependencies": { + "ajv": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-7.1.1.tgz", + "integrity": "sha512-ga/aqDYnUy/o7vbsRTFhhTsNeXiYb5JWDIcRIeZfwRNCefwjNTVYCGdGSUrEmiu3yDK3vFvNbgJxvrQW4JXrYQ==", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + } + }, + "debug": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", + "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true + } + } + }, "eslint-plugin-jsonc": { "version": "0.9.0", "resolved": "https://registry.npmjs.org/eslint-plugin-jsonc/-/eslint-plugin-jsonc-0.9.0.tgz", @@ -8130,6 +8183,18 @@ } } }, + "eslint-plugin-yml": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-yml/-/eslint-plugin-yml-0.7.0.tgz", + "integrity": "sha512-RmX76T+IlZ0DzrGqVf0wUEVk+S0QPLwBIbLycvUgz0PdiSK9rnuQX8EcVc+dPNOD/dUIkUK8LQZzoa57n4bjlg==", + "dev": true, + "requires": { + "debug": "^4.1.1", + "lodash": "^4.17.19", + "natural-compare": "^1.4.0", + "yaml-eslint-parser": "^0.3.2" + } + }, "eslint-scope": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.0.tgz", @@ -16624,6 +16689,23 @@ "integrity": "sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w==", "dev": true }, + "toml-eslint-parser": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/toml-eslint-parser/-/toml-eslint-parser-0.2.1.tgz", + "integrity": "sha512-lAESSx47NjCe/O9Y5dbAmP+U/EFvdxPRgA0Hp4TxCZP3Bs6hxRfLHxZvBuXvTGkVoK0DpYamPz/rCqYBzoFWVQ==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^2.0.0" + }, + "dependencies": { + "eslint-visitor-keys": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.0.0.tgz", + "integrity": "sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ==", + "dev": true + } + } + }, "toposort": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/toposort/-/toposort-1.0.7.tgz", @@ -19308,6 +19390,25 @@ "integrity": "sha512-yr2icI4glYaNG+KWONODapy2/jDdMSDnrONSjblABjD9B4Z5LgiircSt8m8sRZFNi08kG9Sm0uSHtEmP3zaEGg==", "dev": true }, + "yaml-eslint-parser": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/yaml-eslint-parser/-/yaml-eslint-parser-0.3.2.tgz", + "integrity": "sha512-32kYO6kJUuZzqte82t4M/gB6/+11WAuHiEnK7FreMo20xsCKPeFH5tDBU7iWxR7zeJpNnMXfJyXwne48D0hGrg==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^1.3.0", + "lodash": "^4.17.20", + "yaml": "^1.10.0" + }, + "dependencies": { + "lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + } + } + }, "yargs": { "version": "13.3.2", "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz", diff --git a/package.json b/package.json index dddcf276..606c8c6b 100644 --- a/package.json +++ b/package.json @@ -1,120 +1,122 @@ { - "name": "eslint-plugin-vue-scoped-css", - "version": "1.1.0", - "description": "ESLint plugin for Scoped CSS in Vue.js", - "main": "dist/index.js", - "scripts": { - "prebuild": "npm run -s clean", - "build": "tsc --project ./tsconfig.build.json", - "clean": "rimraf .nyc_output dist coverage", - "lint": "eslint \"tests\" \"lib\" \"docs/.vuepress\" --ext .js,.vue,.ts --ignore-pattern \"fixtures\"", - "eslint-fix": "eslint \"tests\" \"lib\" \"docs/.vuepress\" --ext .js,.vue,.ts --ignore-pattern \"fixtures\" --fix", - "pretest": "npm run build", - "test:base": "mocha --require ts-node/register \"tests/**/*.ts\" --reporter dot --timeout 60000", - "test": "npm run test:nyc", - "test:nyc": "nyc --reporter=lcov npm run test:base", - "test:debug": "mocha --require ts-node/register --inspect \"tests/**/*.ts\" --reporter dot", - "test:watch": "npm run test:base -- --watch", - "update": "ts-node ./tools/update.ts && npm run eslint-fix && npm run test:nyc", - "new": "ts-node ./tools/new-rule.ts", - "docs:watch": "vuepress dev --debug docs", - "docs:build": "npm run build && vuepress build docs --no-cache", - "preversion": "npm test && npm run update && git add .", - "version": "npm run lint -- --fix && git add .", - "updatefixture": "cross-env UPDATE_FIXTURE=\"true\" npm run test:base" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/future-architect/eslint-plugin-vue-scoped-css.git" - }, - "author": "Yosuke Ota", - "license": "MIT", - "bugs": { - "url": "https://github.com/future-architect/eslint-plugin-vue-scoped-css/issues" - }, - "homepage": "https://future-architect.github.io/eslint-plugin-vue-scoped-css/", - "keywords": [ - "eslint", - "eslintplugin", - "eslint-plugin", - "vue", - "style", - "scoped", - "css" - ], - "files": [ - "dist" - ], - "devDependencies": { - "@ota-meshi/eslint-plugin": "^0.0.14", - "@types/eslint": "^7.2.0", - "@types/eslint-visitor-keys": "^1.0.0", - "@types/estree": "^0.0.46", - "@types/lodash": "^4.14.157", - "@types/mocha": "^8.0.0", - "@types/semver": "^7.3.1", - "@typescript-eslint/eslint-plugin": "^4.11.0", - "@typescript-eslint/parser": "^4.11.0", - "babel-eslint": "^10.1.0", - "cross-env": "^7.0.2", - "eslint": "^7.19.0", - "eslint-config-prettier": "^7.1.0", - "eslint-plugin-eslint-comments": "^3.2.0", - "eslint-plugin-eslint-plugin": "^2.3.0", - "eslint-plugin-internal-rules": "file:./eslint-internal-rules", - "eslint-plugin-jsonc": "^0.9.0", - "eslint-plugin-node": "^11.1.0", - "eslint-plugin-prettier": "^3.3.0", - "eslint-plugin-regexp": "^0.1.1", - "eslint-plugin-vue": "^7.5.0", - "eslint-plugin-vue-scoped-css": "^1.0.0", - "eslint4b": "^7.19.0", - "mocha": "^8.0.0", - "nyc": "^15.1.0", - "pack": "^2.2.0", - "prettier": "^2.0.5", - "raw-loader": "^4.0.1", - "rimraf": "^3.0.2", - "semver": "^7.3.2", - "stylelint": "^13.6.1", - "stylelint-config-standard": "^20.0.0", - "stylelint-plugin-stylus": "^0.10.0", - "ts-node": "^9.0.0", - "typescript": "^4.1.3", - "vue-eslint-editor": "^1.1.0", - "vue-eslint-parser": "^7.4.1", - "vuepress": "^1.7.1" - }, - "dependencies": { - "eslint-utils": "^2.1.0", - "lodash": "^4.17.19", - "postcss": "^8.2.4", - "postcss-safe-parser": "^5.0.0", - "postcss-scss": "^3.0.0", - "postcss-selector-parser": "^6.0.2", - "postcss-styl": "^0.8.0" - }, - "peerDependencies": { - "eslint": ">=6.0.0", - "vue-eslint-parser": "^7.1.0" - }, - "nyc": { - "include": [ - "lib/*.ts", - "lib/**/*.ts" + "name": "eslint-plugin-vue-scoped-css", + "version": "1.1.0", + "description": "ESLint plugin for Scoped CSS in Vue.js", + "main": "dist/index.js", + "scripts": { + "prebuild": "npm run -s clean", + "build": "tsc --project ./tsconfig.build.json", + "clean": "rimraf .nyc_output dist coverage", + "lint": "eslint . --ext .js,.vue,.ts,.json", + "eslint-fix": "eslint . --ext .js,.vue,.ts,.json --fix", + "pretest": "npm run build", + "test:base": "mocha --require ts-node/register \"tests/**/*.ts\" --reporter dot --timeout 60000", + "test": "npm run test:nyc", + "test:nyc": "nyc --reporter=lcov npm run test:base", + "test:debug": "mocha --require ts-node/register --inspect \"tests/**/*.ts\" --reporter dot", + "test:watch": "npm run test:base -- --watch", + "update": "ts-node ./tools/update.ts && npm run eslint-fix && npm run test:nyc", + "new": "ts-node ./tools/new-rule.ts", + "docs:watch": "vuepress dev --debug docs", + "docs:build": "npm run build && vuepress build docs --no-cache", + "preversion": "npm test && npm run update && git add .", + "version": "npm run lint -- --fix && git add .", + "updatefixture": "cross-env UPDATE_FIXTURE=\"true\" npm run test:base" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/future-architect/eslint-plugin-vue-scoped-css.git" + }, + "author": "Yosuke Ota", + "license": "MIT", + "bugs": { + "url": "https://github.com/future-architect/eslint-plugin-vue-scoped-css/issues" + }, + "homepage": "https://future-architect.github.io/eslint-plugin-vue-scoped-css/", + "keywords": [ + "eslint", + "eslintplugin", + "eslint-plugin", + "vue", + "style", + "scoped", + "css" ], - "extension": [ - ".ts" + "files": [ + "dist" ], - "require": [ - "ts-node/register" - ], - "exclude": [ - "**/*.spec.js", - "tests/**/*.js" - ] - }, - "engines": { - "node": "^8.10.0 || ^10.13.0 || ^12.13.0 || ^13.0.0 || >=14.0.0" - } + "devDependencies": { + "@ota-meshi/eslint-plugin": "^0.0.14", + "@types/eslint": "^7.2.0", + "@types/eslint-visitor-keys": "^1.0.0", + "@types/estree": "^0.0.46", + "@types/lodash": "^4.14.157", + "@types/mocha": "^8.0.0", + "@types/semver": "^7.3.1", + "@typescript-eslint/eslint-plugin": "^4.11.0", + "@typescript-eslint/parser": "^4.11.0", + "babel-eslint": "^10.1.0", + "cross-env": "^7.0.2", + "eslint": "^7.19.0", + "eslint-config-prettier": "^7.1.0", + "eslint-plugin-eslint-comments": "^3.2.0", + "eslint-plugin-eslint-plugin": "^2.3.0", + "eslint-plugin-internal-rules": "file:./eslint-internal-rules", + "eslint-plugin-json-schema-validator": "^0.3.0", + "eslint-plugin-jsonc": "^0.9.0", + "eslint-plugin-node": "^11.1.0", + "eslint-plugin-prettier": "^3.3.0", + "eslint-plugin-regexp": "^0.1.1", + "eslint-plugin-vue": "^7.5.0", + "eslint-plugin-vue-scoped-css": "^1.0.0", + "eslint-plugin-yml": "^0.7.0", + "eslint4b": "^7.19.0", + "mocha": "^8.0.0", + "nyc": "^15.1.0", + "pack": "^2.2.0", + "prettier": "^2.0.5", + "raw-loader": "^4.0.1", + "rimraf": "^3.0.2", + "semver": "^7.3.2", + "stylelint": "^13.6.1", + "stylelint-config-standard": "^20.0.0", + "stylelint-plugin-stylus": "^0.10.0", + "ts-node": "^9.0.0", + "typescript": "^4.1.3", + "vue-eslint-editor": "^1.1.0", + "vue-eslint-parser": "^7.4.1", + "vuepress": "^1.7.1" + }, + "dependencies": { + "eslint-utils": "^2.1.0", + "lodash": "^4.17.19", + "postcss": "^8.2.4", + "postcss-safe-parser": "^5.0.0", + "postcss-scss": "^3.0.0", + "postcss-selector-parser": "^6.0.2", + "postcss-styl": "^0.8.0" + }, + "peerDependencies": { + "eslint": ">=6.0.0", + "vue-eslint-parser": "^7.1.0" + }, + "nyc": { + "include": [ + "lib/*.ts", + "lib/**/*.ts" + ], + "extension": [ + ".ts" + ], + "require": [ + "ts-node/register" + ], + "exclude": [ + "**/*.spec.js", + "tests/**/*.js" + ] + }, + "engines": { + "node": "^8.10.0 || ^10.13.0 || ^12.13.0 || ^13.0.0 || >=14.0.0" + } } diff --git a/renovate.json b/renovate.json index 5c8475b2..6b7368b0 100644 --- a/renovate.json +++ b/renovate.json @@ -1,13 +1,13 @@ { - "extends": ["config:base", ":preserveSemverRanges"], - "packageRules": [ - { - "updateTypes": ["minor", "patch", "pin", "digest"], - "automerge": true - }, - { - "depTypeList": ["devDependencies"], - "automerge": true - } - ] + "extends": ["config:base", ":preserveSemverRanges"], + "packageRules": [ + { + "updateTypes": ["minor", "patch", "pin", "digest"], + "automerge": true + }, + { + "depTypeList": ["devDependencies"], + "automerge": true + } + ] } diff --git a/tools/lib/load-configs.ts b/tools/lib/load-configs.ts index 506f2716..94bdd9b2 100644 --- a/tools/lib/load-configs.ts +++ b/tools/lib/load-configs.ts @@ -5,6 +5,7 @@ import { isDefined } from "../../lib/utils/utils" type Config = { name: string configId: string + // eslint-disable-next-line @typescript-eslint/no-explicit-any -- tools config: any path: string extends: Config[] diff --git a/tools/render-rules.ts b/tools/render-rules.ts index 8411d4f8..ad329103 100644 --- a/tools/render-rules.ts +++ b/tools/render-rules.ts @@ -2,10 +2,10 @@ import categories from "./lib/categories" import type { Rule } from "../lib/types" import { rules } from "../lib/utils/rules" -//eslint-disable-next-line require-jsdoc +//eslint-disable-next-line require-jsdoc -- tools export default function renderRulesTableContent( buildRulePath = (ruleName: string) => `./${ruleName}.md`, -) { +): string { const uncategorizedRules = rules.filter( (rule) => !rule.meta.docs.categories.length && !rule.meta.deprecated, ) @@ -13,7 +13,7 @@ export default function renderRulesTableContent( // ----------------------------------------------------------------------------- - //eslint-disable-next-line require-jsdoc + //eslint-disable-next-line require-jsdoc -- tools function toRuleRow(rule: Rule) { const mark = `${rule.meta.fixable ? ":wrench:" : ""}${ rule.meta.deprecated ? ":warning:" : "" @@ -26,7 +26,7 @@ export default function renderRulesTableContent( return `| ${link} | ${description} | ${mark} |` } - //eslint-disable-next-line require-jsdoc + //eslint-disable-next-line require-jsdoc -- tools function toDeprecatedRuleRow(rule: Rule) { const link = `[${rule.meta.docs.ruleId}](${buildRulePath( rule.meta.docs.ruleName || "", diff --git a/tools/update-docs.ts b/tools/update-docs.ts index aded4db6..b3ce24a4 100644 --- a/tools/update-docs.ts +++ b/tools/update-docs.ts @@ -4,7 +4,7 @@ import { rules } from "../lib/utils/rules" import { configs } from "./lib/load-configs" import type { Rule } from "../lib/types" -//eslint-disable-next-line require-jsdoc +//eslint-disable-next-line require-jsdoc -- tools function formatItems(items: string[]) { if (items.length <= 2) { return items.join(" and ") @@ -14,7 +14,7 @@ function formatItems(items: string[]) { }` } -//eslint-disable-next-line require-jsdoc +//eslint-disable-next-line require-jsdoc -- tools function getPresets(categories: string[]) { const categoryConfigs = configs.filter((conf) => categories.includes(conf.name), @@ -33,7 +33,7 @@ function getPresets(categories: string[]) { return [...presets] } -//eslint-disable-next-line require-jsdoc +//eslint-disable-next-line require-jsdoc, @typescript-eslint/no-explicit-any -- tools function yamlValue(val: any) { if (typeof val === "string") { return `"${val.replace(/"/gu, '\\"')}"` @@ -44,9 +44,12 @@ function yamlValue(val: any) { const ROOT = path.resolve(__dirname, "../docs/rules") class DocFile { - private rule: Rule - private filePath: string + private readonly rule: Rule + + private readonly filePath: string + private content: string + public constructor(rule: Rule) { this.rule = rule this.filePath = path.join(ROOT, `${rule.meta.docs.ruleName}.md`) @@ -176,6 +179,7 @@ class DocFile { description, } const computed = `---\n${Object.keys(fileIntro) + // eslint-disable-next-line @typescript-eslint/no-explicit-any -- tools .map((key) => `${key}: ${yamlValue((fileIntro as any)[key])}`) .join("\n")}\n---\n` diff --git a/tsconfig.build.json b/tsconfig.build.json index d782b5ce..458da017 100644 --- a/tsconfig.build.json +++ b/tsconfig.build.json @@ -1,7 +1,7 @@ { - "extends": "./tsconfig.json", - "exclude": ["tests/**/*", "tools/**/*",], - "compilerOptions": { - "removeComments": true, /* Do not emit comments to output. */ - } -} \ No newline at end of file + "extends": "./tsconfig.json", + "exclude": ["tests/**/*", "tools/**/*"], + "compilerOptions": { + "removeComments": true /* Do not emit comments to output. */ + } +} diff --git a/tsconfig.json b/tsconfig.json index c350157f..8f62f46c 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,67 +1,64 @@ { - "compilerOptions": { - /* Basic Options */ - "target": "es2015", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */ - "module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */ - // "lib": [], /* Specify library files to be included in the compilation. */ - "allowJs": true, /* Allow javascript files to be compiled. */ - "checkJs": true, /* Report errors in .js files. */ - // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ - // "declaration": true, /* Generates corresponding '.d.ts' file. */ - // "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */ - // "sourceMap": true, /* Generates corresponding '.map' file. */ - // "outFile": "./", /* Concatenate and emit output to single file. */ - "outDir": "./dist", /* Redirect output structure to the directory. */ - // "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ - // "composite": true, /* Enable project compilation */ - // "removeComments": true, /* Do not emit comments to output. */ - // "noEmit": true, /* Do not emit outputs. */ - // "importHelpers": true, /* Import emit helpers from 'tslib'. */ - // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */ - // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ + "compilerOptions": { + /* Basic Options */ + "target": "es2015" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */, + "module": "commonjs" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */, + // "lib": [], /* Specify library files to be included in the compilation. */ + "allowJs": true /* Allow javascript files to be compiled. */, + "checkJs": true /* Report errors in .js files. */, + // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ + // "declaration": true, /* Generates corresponding '.d.ts' file. */ + // "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */ + // "sourceMap": true, /* Generates corresponding '.map' file. */ + // "outFile": "./", /* Concatenate and emit output to single file. */ + "outDir": "./dist" /* Redirect output structure to the directory. */, + // "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ + // "composite": true, /* Enable project compilation */ + // "removeComments": true, /* Do not emit comments to output. */ + // "noEmit": true, /* Do not emit outputs. */ + // "importHelpers": true, /* Import emit helpers from 'tslib'. */ + // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */ + // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ - /* Strict Type-Checking Options */ - "strict": true, /* Enable all strict type-checking options. */ - "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ - // "strictNullChecks": true, /* Enable strict null checks. */ - // "strictFunctionTypes": true, /* Enable strict checking of function types. */ - // "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */ - // "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */ - // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ - // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ + /* Strict Type-Checking Options */ + "strict": true /* Enable all strict type-checking options. */, + "noImplicitAny": true /* Raise error on expressions and declarations with an implied 'any' type. */, + // "strictNullChecks": true, /* Enable strict null checks. */ + // "strictFunctionTypes": true, /* Enable strict checking of function types. */ + // "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */ + // "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */ + // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ + // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ - /* Additional Checks */ - "noUnusedLocals": true, /* Report errors on unused locals. */ - "noUnusedParameters": true, /* Report errors on unused parameters. */ - "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ - "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ + /* Additional Checks */ + "noUnusedLocals": true /* Report errors on unused locals. */, + "noUnusedParameters": true /* Report errors on unused parameters. */, + "noImplicitReturns": true /* Report error when not all code paths in function return a value. */, + "noFallthroughCasesInSwitch": true /* Report errors for fallthrough cases in switch statement. */, - /* Module Resolution Options */ - // "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ - "baseUrl": ".", /* Base directory to resolve non-absolute module names. */ - "paths": { /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */ - "*": ["typings/*"] - }, - // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */ - // "typeRoots": [], /* List of folders to include type definitions from. */ - // "types": [], /* Type declaration files to be included in compilation. */ - // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ - "esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */ - // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */ + /* Module Resolution Options */ + // "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ + "baseUrl": "." /* Base directory to resolve non-absolute module names. */, + "paths": { + /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */ + "*": ["typings/*"] + }, + // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */ + // "typeRoots": [], /* List of folders to include type definitions from. */ + // "types": [], /* Type declaration files to be included in compilation. */ + // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ + "esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */ + // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */ - /* Source Map Options */ - // "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ - // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ - // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ - // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ + /* Source Map Options */ + // "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ + // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ + // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ + // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ - /* Experimental Options */ - // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ - // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ - }, - "include": [ - "lib/**/*", - "tests/**/*", - "tools/**/*", - ] -} \ No newline at end of file + /* Experimental Options */ + // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ + // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ + }, + "include": ["lib/**/*", "tests/**/*", "tools/**/*"] +} diff --git a/typings/babel-eslint/index.d.ts b/typings/babel-eslint/index.d.ts index 466254be..583f97ca 100644 --- a/typings/babel-eslint/index.d.ts +++ b/typings/babel-eslint/index.d.ts @@ -1,8 +1,8 @@ -import { Linter } from "eslint" +import type { Linter } from "eslint" declare module "babel-eslint" { function parseForESLint( text: string, - options?: any, + options?: unknown, ): Linter.ESLintParseResult } diff --git a/typings/eslint-scope/index.d.ts b/typings/eslint-scope/index.d.ts index 81fe3806..873a5d53 100644 --- a/typings/eslint-scope/index.d.ts +++ b/typings/eslint-scope/index.d.ts @@ -1,5 +1,4 @@ -// eslint-disable-next-line @mysticatea/node/no-missing-import -import * as estree from "estree" +import type * as estree from "estree" export interface AnalysisOptions { optimistic?: boolean @@ -7,7 +6,7 @@ export interface AnalysisOptions { ignoreEval?: boolean nodejsScope?: boolean impliedStrict?: boolean - fallback?: string | Function + // fallback?: string | Function sourceType?: "script" | "module" ecmaVersion?: number } @@ -70,6 +69,6 @@ export interface Reference { } declare const eslintScope: { - analyze(ast: object, options?: AnalysisOptions): ScopeManager + analyze(ast: unknown, options?: AnalysisOptions): ScopeManager } export default eslintScope diff --git a/typings/eslint-utils/index.d.ts b/typings/eslint-utils/index.d.ts index d5e4013d..63e93944 100644 --- a/typings/eslint-utils/index.d.ts +++ b/typings/eslint-utils/index.d.ts @@ -1,11 +1,13 @@ -import type { ASTNode, AST } from "../../lib/types" -// eslint-disable-next-line @mysticatea/node/no-extraneous-import -import { Scope } from "eslint-scope" +import type { AST } from "../../lib/types" +import type { Scope } from "eslint-scope" declare const utils: { getStaticValue: ( node: AST.ESLintExpression, scope: Scope, - ) => null | { value: any } + ) => null | { + // eslint-disable-next-line @typescript-eslint/no-explicit-any -- ignore + value: any + } } export default utils