diff --git a/.github/dependabot.yml b/.github/dependabot.yml index be4af60..bbca74d 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,12 +1,12 @@ version: 2 updates: - - package-ecosystem: 'github-actions' - directory: '/' + - package-ecosystem: github-actions + directory: / schedule: - interval: 'daily' + interval: daily time: '05:00' - - package-ecosystem: 'npm' - directory: '/' + - package-ecosystem: npm + directory: / schedule: - interval: 'daily' + interval: daily time: '05:00' diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 06fd12b..59236dc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,5 +1,6 @@ name: Build package on: + # eslint-disable-next-line yml/no-empty-mapping-value pull_request: push: branches: main @@ -17,8 +18,8 @@ jobs: ref: ${{ github.event_name == 'pull_request' && github.head_ref || github.ref }} - uses: actions/setup-node@v4 with: - node-version: 'latest' - cache: 'npm' + node-version: latest + cache: npm - name: Lint, format & build code, generate docs run: npm ci - name: Commit & push changes diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 939bad0..d2bb577 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -13,10 +13,10 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: - node-version: 'latest' + node-version: latest registry-url: https://npm.pkg.github.com scope: '@olivierzal' - cache: 'npm' + cache: npm - name: Install dependencies run: npm ci --ignore-scripts - run: npm publish diff --git a/eslint.config.js b/eslint.config.js index 79a1f7c..efb5c65 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -5,6 +5,7 @@ import prettier from 'eslint-config-prettier' import importPlugin from 'eslint-plugin-import' import packageJson from 'eslint-plugin-package-json/configs/recommended' import perfectionist from 'eslint-plugin-perfectionist' +import yml from 'eslint-plugin-yml' import ts, { configs as tsConfigs } from 'typescript-eslint' import { classGroups } from './eslint-utils/class-groups.js' @@ -370,6 +371,22 @@ const config = [ }, ), ...markdown.configs.recommended, + ...yml.configs['flat/standard'], + ...yml.configs['flat/prettier'], + { + rules: { + 'yml/block-mapping-colon-indicator-newline': 'error', + 'yml/file-extension': [ + 'error', + { + extension: 'yml', + }, + ], + 'yml/no-multiple-empty-lines': 'error', + 'yml/no-trailing-zeros': 'error', + 'yml/require-string-key': 'error', + }, + }, packageJson, ] diff --git a/package-lock.json b/package-lock.json index b3eacb3..de41eee 100644 --- a/package-lock.json +++ b/package-lock.json @@ -26,6 +26,7 @@ "eslint-plugin-import": "^2.31.0", "eslint-plugin-package-json": "^0.21.1", "eslint-plugin-perfectionist": "^4.7.0", + "eslint-plugin-yml": "^1.16.0", "jsonc-eslint-parser": "^2.4.0", "prettier": "^3.4.2", "prettier-plugin-packagejson": "^2.5.8", @@ -1490,6 +1491,7 @@ "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.18.0.tgz", "integrity": "sha512-+waTfRWQlSbpt3KWE+CjrPPYnbq9kfZIYUqapc0uBXyjTp8aYXZDsUH16m39Ryq3NjAVP4tjuF7KaukeqoCoaA==", "dev": true, + "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.12.1", @@ -1544,6 +1546,22 @@ } } }, + "node_modules/eslint-compat-utils": { + "version": "0.6.4", + "resolved": "https://registry.npmjs.org/eslint-compat-utils/-/eslint-compat-utils-0.6.4.tgz", + "integrity": "sha512-/u+GQt8NMfXO8w17QendT4gvO5acfxQsAKirAt0LVxDnr2N8YLCVbregaNc/Yhp7NM128DwCaRvr8PLDfeNkQw==", + "dev": true, + "license": "MIT", + "dependencies": { + "semver": "^7.5.4" + }, + "engines": { + "node": ">=12" + }, + "peerDependencies": { + "eslint": ">=6.0.0" + } + }, "node_modules/eslint-config-prettier": { "version": "10.0.1", "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-10.0.1.tgz", @@ -1843,6 +1861,29 @@ "url": "https://opencollective.com/typescript-eslint" } }, + "node_modules/eslint-plugin-yml": { + "version": "1.16.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-yml/-/eslint-plugin-yml-1.16.0.tgz", + "integrity": "sha512-t4MNCetPjTn18/fUDlQ/wKkcYjnuLYKChBrZ0qUaNqRigVqChHWzTP8SrfFi5s4keX3vdlkWRSu8zHJMdKwxWQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "debug": "^4.3.2", + "eslint-compat-utils": "^0.6.0", + "lodash": "^4.17.21", + "natural-compare": "^1.4.0", + "yaml-eslint-parser": "^1.2.1" + }, + "engines": { + "node": "^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ota-meshi" + }, + "peerDependencies": { + "eslint": ">=6.0.0" + } + }, "node_modules/eslint-scope": { "version": "8.2.0", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.2.0.tgz", @@ -2930,6 +2971,13 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true, + "license": "MIT" + }, "node_modules/lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", @@ -5098,6 +5146,37 @@ "node": ">= 14" } }, + "node_modules/yaml-eslint-parser": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/yaml-eslint-parser/-/yaml-eslint-parser-1.2.3.tgz", + "integrity": "sha512-4wZWvE398hCP7O8n3nXKu/vdq1HcH01ixYlCREaJL5NUMwQ0g3MaGFUBNSlmBtKmhbtVG/Cm6lyYmSVTEVil8A==", + "dev": true, + "license": "MIT", + "dependencies": { + "eslint-visitor-keys": "^3.0.0", + "lodash": "^4.17.21", + "yaml": "^2.0.0" + }, + "engines": { + "node": "^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ota-meshi" + } + }, + "node_modules/yaml-eslint-parser/node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, "node_modules/yargs": { "version": "17.7.2", "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", diff --git a/package.json b/package.json index 1fcb69e..42e9a91 100644 --- a/package.json +++ b/package.json @@ -51,6 +51,7 @@ "eslint-plugin-import": "^2.31.0", "eslint-plugin-package-json": "^0.21.1", "eslint-plugin-perfectionist": "^4.7.0", + "eslint-plugin-yml": "^1.16.0", "jsonc-eslint-parser": "^2.4.0", "prettier": "^3.4.2", "prettier-plugin-packagejson": "^2.5.8",