diff --git a/.eslintrc.js b/.eslintrc.js index a894142..5582480 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,75 +1,75 @@ -"use strict" +"use strict"; // const version = require("./package.json").version module.exports = { - parserOptions: { - sourceType: "script", - ecmaVersion: 2020, + parserOptions: { + sourceType: "script", + ecmaVersion: 2020, + }, + extends: [ + "plugin:@ota-meshi/recommended", + "plugin:@ota-meshi/+node", + "plugin:@ota-meshi/+typescript", + "plugin:@ota-meshi/+prettier", + "plugin:@ota-meshi/+json", + ], + rules: { + "require-jsdoc": "error", + "no-warning-comments": "warn", + "no-lonely-if": "off", + "one-var": "off", + }, + overrides: [ + { + files: ["*.ts"], + parser: "@typescript-eslint/parser", + parserOptions: { + sourceType: "module", + project: "./tsconfig.json", + }, + rules: { + "@typescript-eslint/naming-convention": [ + "error", + { + selector: "default", + format: ["camelCase"], + leadingUnderscore: "allow", + trailingUnderscore: "allow", + }, + { + selector: "variable", + format: ["camelCase", "UPPER_CASE"], + leadingUnderscore: "allow", + trailingUnderscore: "allow", + }, + { + selector: "typeLike", + format: ["PascalCase"], + }, + { + selector: "property", + format: null, + }, + { + selector: "method", + format: null, + }, + ], + "no-implicit-globals": "off", + "@typescript-eslint/no-non-null-assertion": "off", + "@typescript-eslint/no-use-before-define": "off", + "@typescript-eslint/no-explicit-any": "off", + "no-invalid-this": "off", + "@typescript-eslint/no-invalid-this": ["error"], + }, }, - extends: [ - "plugin:@ota-meshi/recommended", - "plugin:@ota-meshi/+node", - "plugin:@ota-meshi/+typescript", - "plugin:@ota-meshi/+prettier", - "plugin:@ota-meshi/+json", - ], - rules: { - "require-jsdoc": "error", - "no-warning-comments": "warn", - "no-lonely-if": "off", - "one-var": "off", + { + files: ["scripts/**/*.ts", "tests/**/*.ts"], + rules: { + "require-jsdoc": "off", + "no-console": "off", + }, }, - overrides: [ - { - files: ["*.ts"], - parser: "@typescript-eslint/parser", - parserOptions: { - sourceType: "module", - project: "./tsconfig.json", - }, - rules: { - "@typescript-eslint/naming-convention": [ - "error", - { - selector: "default", - format: ["camelCase"], - leadingUnderscore: "allow", - trailingUnderscore: "allow", - }, - { - selector: "variable", - format: ["camelCase", "UPPER_CASE"], - leadingUnderscore: "allow", - trailingUnderscore: "allow", - }, - { - selector: "typeLike", - format: ["PascalCase"], - }, - { - selector: "property", - format: null, - }, - { - selector: "method", - format: null, - }, - ], - "no-implicit-globals": "off", - "@typescript-eslint/no-non-null-assertion": "off", - "@typescript-eslint/no-use-before-define": "off", - "@typescript-eslint/no-explicit-any": "off", - "no-invalid-this": "off", - "@typescript-eslint/no-invalid-this": ["error"], - }, - }, - { - files: ["scripts/**/*.ts", "tests/**/*.ts"], - rules: { - "require-jsdoc": "off", - "no-console": "off", - }, - }, - ], -} + ], +}; diff --git a/explorer/.eslintrc.js b/explorer/.eslintrc.js index 60a13e0..35a03ca 100644 --- a/explorer/.eslintrc.js +++ b/explorer/.eslintrc.js @@ -1,15 +1,15 @@ module.exports = { - parserOptions: { - sourceType: "module", - ecmaVersion: 2020, - }, - extends: [ - "plugin:@ota-meshi/+vue3", - "plugin:@ota-meshi/+prettier", - "plugin:@ota-meshi/+json", - ], - rules: { - "node/no-unsupported-features/es-syntax": "off", - "node/no-missing-import": "off", - }, -} + parserOptions: { + sourceType: "module", + ecmaVersion: 2020, + }, + extends: [ + "plugin:@ota-meshi/+vue3", + "plugin:@ota-meshi/+prettier", + "plugin:@ota-meshi/+json", + ], + rules: { + "node/no-unsupported-features/es-syntax": "off", + "node/no-missing-import": "off", + }, +}; diff --git a/explorer/babel.config.js b/explorer/babel.config.js index 416b0eb..162a3ea 100644 --- a/explorer/babel.config.js +++ b/explorer/babel.config.js @@ -1,3 +1,3 @@ module.exports = { - presets: ["@vue/cli-plugin-babel/preset"], -} + presets: ["@vue/cli-plugin-babel/preset"], +}; diff --git a/explorer/package.json b/explorer/package.json index a013a60..e442b3f 100644 --- a/explorer/package.json +++ b/explorer/package.json @@ -1,23 +1,23 @@ { - "name": "yaml-eslint-parser-ast-explorer", - "version": "0.1.0", - "private": true, - "scripts": { - "serve": "vue-cli-service serve", - "build": "vue-cli-service build" - }, - "dependencies": { - "core-js": "^3.6.5", - "vue": "^3.0.0" - }, - "devDependencies": { - "@vue/cli-plugin-babel": "~5.0.0", - "@vue/cli-service": "~5.0.0", - "@vue/compiler-sfc": "^3.0.0" - }, - "browserslist": [ - "> 1%", - "last 2 versions", - "not dead" - ] + "name": "yaml-eslint-parser-ast-explorer", + "version": "0.1.0", + "private": true, + "scripts": { + "serve": "vue-cli-service serve", + "build": "vue-cli-service build" + }, + "dependencies": { + "core-js": "^3.6.5", + "vue": "^3.0.0" + }, + "devDependencies": { + "@vue/cli-plugin-babel": "~5.0.0", + "@vue/cli-service": "~5.0.0", + "@vue/compiler-sfc": "^3.0.0" + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not dead" + ] } diff --git a/explorer/src/main.js b/explorer/src/main.js index 1d22108..b670de8 100644 --- a/explorer/src/main.js +++ b/explorer/src/main.js @@ -1,4 +1,4 @@ -import { createApp } from "vue" -import App from "./App.vue" +import { createApp } from "vue"; +import App from "./App.vue"; -createApp(App).mount("#app") +createApp(App).mount("#app"); diff --git a/explorer/vue.config.js b/explorer/vue.config.js index 3b8b2d0..9dd2d4f 100644 --- a/explorer/vue.config.js +++ b/explorer/vue.config.js @@ -1,3 +1,3 @@ module.exports = { - publicPath: "/yaml-eslint-parser/", -} + publicPath: "/yaml-eslint-parser/", +}; diff --git a/package.json b/package.json index cfc0f2f..3746daa 100644 --- a/package.json +++ b/package.json @@ -1,73 +1,73 @@ { - "name": "yaml-eslint-parser", - "version": "1.0.1", - "description": "A YAML parser that produces output compatible with ESLint", - "main": "lib/index.js", - "files": [ - "lib" - ], - "engines": { - "node": "^14.17.0 || >=16.0.0" - }, - "scripts": { - "prebuild": "npm run -s clean", - "build": "tsc --project ./tsconfig.build.json", - "clean": "rimraf .nyc_output lib coverage", - "lint": "eslint . --ext .js,.ts,.json", - "eslint-fix": "npm run lint -- --fix", - "test": "mocha --require ts-node/register \"tests/src/**/*.ts\" --reporter dot --timeout 60000", - "cover": "nyc --reporter=lcov npm run test", - "debug": "mocha --require ts-node/register/transpile-only \"tests/src/**/*.ts\" --reporter dot", - "preversion": "npm run lint && npm test", - "update-fixtures": "ts-node ./tools/update-fixtures.ts", - "benchmark": "ts-node --transpile-only benchmark/index.ts" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/ota-meshi/yaml-eslint-parser.git" - }, - "keywords": [ - "yaml", - "eslint", - "parser" - ], - "author": "Yosuke Ota", - "funding": "https://github.com/sponsors/ota-meshi", - "license": "MIT", - "bugs": { - "url": "https://github.com/ota-meshi/yaml-eslint-parser/issues" - }, - "homepage": "https://github.com/ota-meshi/yaml-eslint-parser#readme", - "dependencies": { - "eslint-visitor-keys": "^3.0.0", - "lodash": "^4.17.21", - "yaml": "^2.0.0" - }, - "devDependencies": { - "@ota-meshi/eslint-plugin": "^0.10.0", - "@types/benchmark": "^2.1.1", - "@types/eslint": "^8.0.0", - "@types/eslint-visitor-keys": "^1.0.0", - "@types/lodash": "^4.14.167", - "@types/mocha": "^9.0.0", - "@types/node": "^16.0.0", - "@typescript-eslint/eslint-plugin": "^5.0.0", - "@typescript-eslint/parser": "^5.0.0", - "benchmark": "^2.1.4", - "eslint": "^8.0.0", - "eslint-config-prettier": "^8.0.0", - "eslint-plugin-eslint-comments": "^3.2.0", - "eslint-plugin-json-schema-validator": "^3.0.0", - "eslint-plugin-jsonc": "^2.0.0", - "eslint-plugin-node": "^11.1.0", - "eslint-plugin-prettier": "^4.0.0", - "eslint-plugin-regexp": "^1.0.0", - "eslint-plugin-vue": "^9.0.0", - "mocha": "^10.0.0", - "nyc": "^15.1.0", - "prettier": "^2.0.5", - "ts-node": "^10.0.0", - "typescript": "^4.0.0", - "vue-eslint-parser": "^9.0.0" - } + "name": "yaml-eslint-parser", + "version": "1.0.1", + "description": "A YAML parser that produces output compatible with ESLint", + "main": "lib/index.js", + "files": [ + "lib" + ], + "engines": { + "node": "^14.17.0 || >=16.0.0" + }, + "scripts": { + "prebuild": "npm run -s clean", + "build": "tsc --project ./tsconfig.build.json", + "clean": "rimraf .nyc_output lib coverage", + "lint": "eslint . --ext .js,.ts,.json", + "eslint-fix": "npm run lint -- --fix", + "test": "mocha --require ts-node/register \"tests/src/**/*.ts\" --reporter dot --timeout 60000", + "cover": "nyc --reporter=lcov npm run test", + "debug": "mocha --require ts-node/register/transpile-only \"tests/src/**/*.ts\" --reporter dot", + "preversion": "npm run lint && npm test", + "update-fixtures": "ts-node ./tools/update-fixtures.ts", + "benchmark": "ts-node --transpile-only benchmark/index.ts" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/ota-meshi/yaml-eslint-parser.git" + }, + "keywords": [ + "yaml", + "eslint", + "parser" + ], + "author": "Yosuke Ota", + "funding": "https://github.com/sponsors/ota-meshi", + "license": "MIT", + "bugs": { + "url": "https://github.com/ota-meshi/yaml-eslint-parser/issues" + }, + "homepage": "https://github.com/ota-meshi/yaml-eslint-parser#readme", + "dependencies": { + "eslint-visitor-keys": "^3.0.0", + "lodash": "^4.17.21", + "yaml": "^2.0.0" + }, + "devDependencies": { + "@ota-meshi/eslint-plugin": "^0.11.0", + "@types/benchmark": "^2.1.1", + "@types/eslint": "^8.0.0", + "@types/eslint-visitor-keys": "^1.0.0", + "@types/lodash": "^4.14.167", + "@types/mocha": "^9.0.0", + "@types/node": "^16.0.0", + "@typescript-eslint/eslint-plugin": "^5.0.0", + "@typescript-eslint/parser": "^5.0.0", + "benchmark": "^2.1.4", + "eslint": "^8.0.0", + "eslint-config-prettier": "^8.0.0", + "eslint-plugin-eslint-comments": "^3.2.0", + "eslint-plugin-json-schema-validator": "^3.0.0", + "eslint-plugin-jsonc": "^2.0.0", + "eslint-plugin-node": "^11.1.0", + "eslint-plugin-prettier": "^4.0.0", + "eslint-plugin-regexp": "^1.0.0", + "eslint-plugin-vue": "^9.0.0", + "mocha": "^10.0.0", + "nyc": "^15.1.0", + "prettier": "^2.0.5", + "ts-node": "^10.0.0", + "typescript": "^4.0.0", + "vue-eslint-parser": "^9.0.0" + } } diff --git a/renovate.json b/renovate.json index ab68d9f..2520029 100644 --- a/renovate.json +++ b/renovate.json @@ -1,17 +1,17 @@ { - "extends": [ - "config:base", - ":preserveSemverRanges", - ":disableDependencyDashboard" - ], - "packageRules": [ - { - "updateTypes": ["minor", "patch", "pin", "digest"], - "automerge": true - }, - { - "depTypeList": ["devDependencies"], - "automerge": true - } - ] + "extends": [ + "config:base", + ":preserveSemverRanges", + ":disableDependencyDashboard" + ], + "packageRules": [ + { + "updateTypes": ["minor", "patch", "pin", "digest"], + "automerge": true + }, + { + "depTypeList": ["devDependencies"], + "automerge": true + } + ] } diff --git a/tsconfig.build.json b/tsconfig.build.json index 91a36b2..101ad79 100644 --- a/tsconfig.build.json +++ b/tsconfig.build.json @@ -1,8 +1,8 @@ { - "extends": "./tsconfig.json", - "include": ["src/index.ts"], - "compilerOptions": { - "rootDir": "src", - "outDir": "lib" - } + "extends": "./tsconfig.json", + "include": ["src/index.ts"], + "compilerOptions": { + "rootDir": "src", + "outDir": "lib" + } } diff --git a/tsconfig.json b/tsconfig.json index fc26b24..292bdcf 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,21 +1,16 @@ { - "compilerOptions": { - "target": "es2015", - "strict": true, - "lib": ["es2020"], - "module": "commonjs", - "declaration": true, - "noImplicitAny": true, - "noImplicitReturns": true, - "noFallthroughCasesInSwitch": true, - "noUnusedLocals": true, - "noUnusedParameters": true, - "esModuleInterop": true - }, - "include": [ - "src/**/*.ts", - "tests/**/*.ts", - "tools/**/*.ts", - "benchmark/**/*" - ] + "compilerOptions": { + "target": "es2015", + "strict": true, + "lib": ["es2020"], + "module": "commonjs", + "declaration": true, + "noImplicitAny": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "esModuleInterop": true + }, + "include": ["src/**/*.ts", "tests/**/*.ts", "tools/**/*.ts", "benchmark/**/*"] }