Skip to content

Commit 562fab3

Browse files
committed
feat(ci): eslint and prettier
1 parent 8414645 commit 562fab3

File tree

8 files changed

+764
-605
lines changed

8 files changed

+764
-605
lines changed

.editorconfig

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@ root = true
22

33
[*]
44
charset = utf-8
5-
end_of_line = lf
6-
insert_final_newline = true
7-
trim_trailing_whitespace = true
85

96
[*.{json,toml,yml,gyp}]
107
indent_style = space
@@ -14,14 +11,18 @@ indent_size = 2
1411
indent_style = space
1512
indent_size = 2
1613

17-
[*.rs]
14+
[*.scm]
1815
indent_style = space
19-
indent_size = 4
16+
indent_size = 2
2017

2118
[*.{c,cc,h}]
2219
indent_style = space
2320
indent_size = 4
2421

22+
[*.rs]
23+
indent_style = space
24+
indent_size = 4
25+
2526
[*.{py,pyi}]
2627
indent_style = space
2728
indent_size = 4
@@ -37,3 +38,9 @@ indent_size = 8
3738
[Makefile]
3839
indent_style = tab
3940
indent_size = 8
41+
42+
[parser.c]
43+
indent_size = 2
44+
45+
[{alloc,array,parser}.h]
46+
indent_size = 2

.github/workflows/lint.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Lint
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- grammar.js
8+
pull_request:
9+
paths:
10+
- grammar.js
11+
12+
jobs:
13+
lint:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
- name: Set up Node.js
19+
uses: actions/setup-node@v4
20+
with:
21+
cache: npm
22+
node-version: ${{vars.NODE_VERSION}}
23+
- name: Install modules
24+
run: npm ci --legacy-peer-deps
25+
- name: Run ESLint
26+
run: npm run lint
27+
- name: Run Prettier
28+
run: npm run format

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Publish packages
22

33
on:
44
push:
5-
tags: ["*"]
5+
tags: ['*']
66

77
permissions:
88
contents: write

.prettierrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"semi": true,
3+
"singleQuote": true,
4+
"tabWidth": 2,
5+
"printWidth": 80,
6+
"trailingComma": "all"
7+
}

eslint.config.mjs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import treesitter from 'eslint-config-treesitter';
2+
import prettier from 'eslint-config-prettier';
23

3-
export default [
4-
...treesitter,
5-
];
4+
export default [...treesitter, prettier];

0 commit comments

Comments
 (0)