Skip to content

Commit b658a77

Browse files
committed
Chore: YAML Lint & ESlint Config to packages.json
1 parent 1eda8ba commit b658a77

File tree

9 files changed

+123
-24
lines changed

9 files changed

+123
-24
lines changed

.github/actions/node-setup/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
name: "Setup"
1+
name: Setup
22

33
runs:
4-
using: "composite"
4+
using: composite
55
steps:
66
# https://github.com/actions/cache/blob/main/examples.md#node---yarn
77
# https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
const { defineConfig } = require('eslint-define-config');
2+
3+
module.exports = defineConfig({
4+
$schema: "https://json.schemastore.org/eslintrc.json",
5+
parser: "yaml-eslint-parser",
6+
parserOptions: {
7+
defaultYAMLVersion: "1.2"
8+
},
9+
extends: [
10+
"eslint:recommended",
11+
"plugin:yml/standard",
12+
"plugin:yml/prettier",
13+
"prettier",
14+
"plugin:prettier/recommended"
15+
],
16+
rules: {
17+
"prettier/prettier": ["error", { "endOfLine": "auto" }]
18+
},
19+
env: {
20+
node: true
21+
},
22+
ignorePatterns: ["dist/**", "node_modules/**", "coverage/**"]
23+
});
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"name": "eslint-config-yaml",
3+
"version": "0.0.0",
4+
"private": true,
5+
"main": "index.js",
6+
"license": "MIT",
7+
"devDependencies": {
8+
"eslint-define-config": "^1.24.1",
9+
"yaml-eslint-parser": "^1.2.2"
10+
},
11+
"peerDependencies": {
12+
"eslint": "*"
13+
}
14+
}

package.json

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,16 @@
1010
"scripts": {
1111
"clean": "turbo run clean",
1212
"build": "turbo run build",
13-
"lint": "turbo run lint",
14-
"fix": "turbo run fix",
13+
"lint": "yarn lint:action && turbo run lint",
14+
"fix": "yarn fix:action && turbo run fix",
1515
"check": "turbo run check",
1616
"check:all": "turbo run check:all",
1717
"test": "turbo run test",
1818
"test:all": "turbo run test:all",
1919
"coverage": "turbo run coverage",
2020
"coverage:all": "turbo run coverage:all",
21+
"lint:action": "yarn run -T eslint '.github/**/*.{js,yaml,yml}'",
22+
"fix:action": "yarn lint:action --fix",
2123
"g:clean": "cd $INIT_CWD && yarn run -T rimraf dist coverage .turbo tsconfig.tsbuildinfo node_modules/.vite",
2224
"g:build": "cd $INIT_CWD && yarn run -T vite build",
2325
"g:build-watch": "cd $INIT_CWD && yarn run build --watch",
@@ -28,24 +30,29 @@
2830
"g:fix": "cd $INIT_CWD && yarn g:lint --fix",
2931
"g:check": "cd $INIT_CWD && yarn run -T tsc --noEmit"
3032
},
33+
"eslintConfig": {
34+
"extends": ["yaml"]
35+
},
3136
"devDependencies": {
3237
"@types/eslint": "^8.44.7",
3338
"@types/node": "^20.8.10",
39+
"@typescript-eslint/eslint-plugin": "^6.10.0",
3440
"@vitest/coverage-v8": "^0.34.6",
3541
"c8": "^8.0.1",
42+
"eslint": "^8.53.0",
43+
"eslint-config-prettier": "^9.0.0",
44+
"eslint-config-yaml": "workspace:^",
45+
"eslint-plugin-prettier": "^5.0.1",
46+
"eslint-plugin-yml": "^1.10.0",
47+
"prettier": "^3.0.3",
3648
"rimraf": "^5.0.5",
49+
"terser": "^5.24.0",
3750
"turbo": "^1.10.16",
3851
"typescript": "^5.2.2",
3952
"vite": "^4.5.0",
4053
"vitest": "^0.34.6"
4154
},
4255
"dependencies": {
43-
"@typescript-eslint/eslint-plugin": "^6.10.0",
44-
"eslint": "^8.53.0",
45-
"eslint-config-prettier": "^9.0.0",
46-
"eslint-plugin-prettier": "^5.0.1",
47-
"prettier": "^3.0.3",
48-
"terser": "^5.24.0",
4956
"tslib": "^2.6.2"
5057
}
5158
}

packages/css/.eslintrc.cjs

Lines changed: 0 additions & 6 deletions
This file was deleted.

packages/css/package.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@
3030
"check": "yarn g:check"
3131
},
3232
"prettier": "prettier-config-custom",
33+
"eslintConfig": {
34+
"extends": ["custom"],
35+
"parserOptions": {
36+
"project": ["./tsconfig.json", "./tsconfig.node.json"]
37+
}
38+
},
3339
"dependencies": {
3440
"@mincho/transform-to-vanilla": "workspace:^"
3541
},

packages/transform-to-vanilla/.eslintrc.cjs

Lines changed: 0 additions & 6 deletions
This file was deleted.

packages/transform-to-vanilla/package.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@
3333
"check": "yarn g:check"
3434
},
3535
"prettier": "prettier-config-custom",
36+
"eslintConfig": {
37+
"extends": ["custom"],
38+
"parserOptions": {
39+
"project": ["./tsconfig.json", "./tsconfig.node.json"]
40+
}
41+
},
3642
"devDependencies": {
3743
"@vanilla-extract/css": "^1.13.0",
3844
"eslint-config-custom": "workspace:^",

yarn.lock

Lines changed: 57 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1948,6 +1948,15 @@ __metadata:
19481948
languageName: node
19491949
linkType: hard
19501950

1951+
"eslint-compat-utils@npm:^0.1.0":
1952+
version: 0.1.2
1953+
resolution: "eslint-compat-utils@npm:0.1.2"
1954+
peerDependencies:
1955+
eslint: ">=6.0.0"
1956+
checksum: 2315d9db81efb7f58808053bf32a1d5970b38e01cd8244f4f1b5aa05d883255c5c93fc184e9c29a0e7e2dcf16ff16330977302474d3fa870e41c5bed9c66f76b
1957+
languageName: node
1958+
linkType: hard
1959+
19511960
"eslint-config-custom@workspace:^, eslint-config-custom@workspace:configs/eslint-config-custom":
19521961
version: 0.0.0-use.local
19531962
resolution: "eslint-config-custom@workspace:configs/eslint-config-custom"
@@ -1970,6 +1979,17 @@ __metadata:
19701979
languageName: node
19711980
linkType: hard
19721981

1982+
"eslint-config-yaml@workspace:^, eslint-config-yaml@workspace:configs/eslint-conifg-yaml":
1983+
version: 0.0.0-use.local
1984+
resolution: "eslint-config-yaml@workspace:configs/eslint-conifg-yaml"
1985+
dependencies:
1986+
eslint-define-config: ^1.24.1
1987+
yaml-eslint-parser: ^1.2.2
1988+
peerDependencies:
1989+
eslint: "*"
1990+
languageName: unknown
1991+
linkType: soft
1992+
19731993
"eslint-define-config@npm:^1.24.1":
19741994
version: 1.24.1
19751995
resolution: "eslint-define-config@npm:1.24.1"
@@ -1996,6 +2016,21 @@ __metadata:
19962016
languageName: node
19972017
linkType: hard
19982018

2019+
"eslint-plugin-yml@npm:^1.10.0":
2020+
version: 1.10.0
2021+
resolution: "eslint-plugin-yml@npm:1.10.0"
2022+
dependencies:
2023+
debug: ^4.3.2
2024+
eslint-compat-utils: ^0.1.0
2025+
lodash: ^4.17.21
2026+
natural-compare: ^1.4.0
2027+
yaml-eslint-parser: ^1.2.1
2028+
peerDependencies:
2029+
eslint: ">=6.0.0"
2030+
checksum: bd913df237a9ee65388389b4ba65c68dbb169d041237d8e8ca1e2f415f0202e0a85aabafdc59d2688bb11ae319d1972df7e292cf0c637b1ebe88ae518497ffff
2031+
languageName: node
2032+
linkType: hard
2033+
19992034
"eslint-scope@npm:^7.2.2":
20002035
version: 7.2.2
20012036
resolution: "eslint-scope@npm:7.2.2"
@@ -2006,7 +2041,7 @@ __metadata:
20062041
languageName: node
20072042
linkType: hard
20082043

2009-
"eslint-visitor-keys@npm:^3.3.0, eslint-visitor-keys@npm:^3.4.1, eslint-visitor-keys@npm:^3.4.3":
2044+
"eslint-visitor-keys@npm:^3.0.0, eslint-visitor-keys@npm:^3.3.0, eslint-visitor-keys@npm:^3.4.1, eslint-visitor-keys@npm:^3.4.3":
20102045
version: 3.4.3
20112046
resolution: "eslint-visitor-keys@npm:3.4.3"
20122047
checksum: 36e9ef87fca698b6fd7ca5ca35d7b2b6eeaaf106572e2f7fd31c12d3bfdaccdb587bba6d3621067e5aece31c8c3a348b93922ab8f7b2cbc6aaab5e1d89040c60
@@ -2929,7 +2964,7 @@ __metadata:
29292964
languageName: node
29302965
linkType: hard
29312966

2932-
"lodash@npm:~4.17.15":
2967+
"lodash@npm:^4.17.21, lodash@npm:~4.17.15":
29332968
version: 4.17.21
29342969
resolution: "lodash@npm:4.17.21"
29352970
checksum: eb835a2e51d381e561e508ce932ea50a8e5a68f4ebdd771ea240d3048244a8d13658acbd502cd4829768c56f2e16bdd4340b9ea141297d472517b83868e677f7
@@ -3056,7 +3091,9 @@ __metadata:
30563091
c8: ^8.0.1
30573092
eslint: ^8.53.0
30583093
eslint-config-prettier: ^9.0.0
3094+
eslint-config-yaml: "workspace:^"
30593095
eslint-plugin-prettier: ^5.0.1
3096+
eslint-plugin-yml: ^1.10.0
30603097
prettier: ^3.0.3
30613098
rimraf: ^5.0.5
30623099
terser: ^5.24.0
@@ -4707,6 +4744,24 @@ __metadata:
47074744
languageName: node
47084745
linkType: hard
47094746

4747+
"yaml-eslint-parser@npm:^1.2.1, yaml-eslint-parser@npm:^1.2.2":
4748+
version: 1.2.2
4749+
resolution: "yaml-eslint-parser@npm:1.2.2"
4750+
dependencies:
4751+
eslint-visitor-keys: ^3.0.0
4752+
lodash: ^4.17.21
4753+
yaml: ^2.0.0
4754+
checksum: 06e8b8e4f5624731e05618a11e42e4727f99ae75c7c9b1f9986ba020d194580d11fc660674320720e45c27e75bb0044954d95fa1a6b7d5f6f9250af1e43dbeec
4755+
languageName: node
4756+
linkType: hard
4757+
4758+
"yaml@npm:^2.0.0":
4759+
version: 2.3.4
4760+
resolution: "yaml@npm:2.3.4"
4761+
checksum: e6d1dae1c6383bcc8ba11796eef3b8c02d5082911c6723efeeb5ba50fc8e881df18d645e64de68e421b577296000bea9c75d6d9097c2f6699da3ae0406c030d8
4762+
languageName: node
4763+
linkType: hard
4764+
47104765
"yargs-parser@npm:^21.1.1":
47114766
version: 21.1.1
47124767
resolution: "yargs-parser@npm:21.1.1"

0 commit comments

Comments
 (0)