Skip to content

Commit

Permalink
eslint/yml
Browse files Browse the repository at this point in the history
  • Loading branch information
OlivierZal committed Jan 24, 2025
1 parent b71e596 commit 75b275d
Show file tree
Hide file tree
Showing 6 changed files with 108 additions and 10 deletions.
12 changes: 6 additions & 6 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -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'
5 changes: 3 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: Build package
on:
# eslint-disable-next-line yml/no-empty-mapping-value
pull_request:
push:
branches: main
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
17 changes: 17 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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,
]

Expand Down
79 changes: 79 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 75b275d

Please sign in to comment.