Skip to content

Commit c10b441

Browse files
committed
chore: lint and prettier
1 parent 27aef9b commit c10b441

8 files changed

Lines changed: 203 additions & 144 deletions

File tree

.github/workflows/code-quality.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Code Quality
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
types: [opened, synchronize, reopened]
8+
9+
jobs:
10+
quality:
11+
name: Code Quality
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: Use Node.js
18+
uses: actions/setup-node@v4
19+
with:
20+
node-version: '20.x'
21+
cache: 'yarn'
22+
23+
- name: Install Yarn
24+
run: corepack enable
25+
26+
- name: Install dependencies
27+
run: yarn install --frozen-lockfile
28+
29+
- name: Run linting
30+
run: yarn lint
31+
32+
- name: Check formatting
33+
run: yarn prettier --check "**/*.{ts,js,yml}"

.github/workflows/codecov.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: Code Coverage
22

33
on:
44
push:
5-
branches: [ master ]
5+
branches: [master]
66
pull_request:
7-
branches: [ master ]
7+
branches: [master]
88

99
jobs:
1010
coverage:
@@ -17,7 +17,7 @@ jobs:
1717
- name: Setup Node.js
1818
uses: actions/setup-node@v4
1919
with:
20-
node-version: "20"
20+
node-version: '20'
2121
cache: 'yarn'
2222

2323
- name: Install dependencies
@@ -30,4 +30,4 @@ jobs:
3030
uses: codecov/codecov-action@v4
3131
with:
3232
token: ${{ secrets.CODECOV_TOKEN }}
33-
fail_ci_if_error: true
33+
fail_ci_if_error: true

.releaserc.json

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

eslint.config.js

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
const eslint = require('@eslint/js');
2+
const tseslint = require('typescript-eslint');
3+
const prettier = require('eslint-plugin-prettier');
4+
const importPlugin = require('eslint-plugin-import');
5+
6+
module.exports = tseslint.config(
7+
eslint.configs.recommended,
8+
...tseslint.configs.recommended,
9+
{
10+
files: ['**/*.ts'],
11+
languageOptions: {
12+
ecmaVersion: 2018,
13+
sourceType: 'module',
14+
parser: tseslint.parser,
15+
parserOptions: {
16+
project: './tsconfig.json',
17+
},
18+
},
19+
plugins: {
20+
'@typescript-eslint': tseslint.plugin,
21+
'prettier': prettier,
22+
'import': importPlugin,
23+
},
24+
rules: {
25+
'prettier/prettier': 'error',
26+
'no-console': 'off',
27+
'import/no-unresolved': 'off',
28+
'import/extensions': 'off',
29+
'comma-dangle': 'off',
30+
'no-unused-vars': 'off',
31+
'camelcase': 'off',
32+
},
33+
settings: {
34+
'import/resolver': {
35+
typescript: {},
36+
},
37+
},
38+
},
39+
{
40+
files: ['**/*.js'],
41+
languageOptions: {
42+
ecmaVersion: 2018,
43+
sourceType: 'module',
44+
},
45+
plugins: {
46+
'prettier': prettier,
47+
'import': importPlugin,
48+
},
49+
rules: {
50+
'prettier/prettier': 'error',
51+
'no-console': 'off',
52+
'import/no-unresolved': 'off',
53+
'import/extensions': 'off',
54+
'comma-dangle': 'off',
55+
},
56+
},
57+
{
58+
ignores: ['dist/**', 'node_modules/**', 'coverage/**'],
59+
}
60+
);

package.json

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
"scripts": {
1111
"setup": "yarn",
1212
"build": "tsc",
13-
"format": "prettier --write \"**/*.{json,md,ts,tsx,yml,js,jsx}\"",
13+
"format": "prettier --write \"**/*.{json,ts,tsx,yml,js,jsx}\"",
1414
"test": "jest --config jestconfig.json",
15-
"lint": "eslint --ext=js,ts ."
15+
"lint": "eslint ."
1616
},
1717
"keywords": [
1818
"wcwidth",
@@ -23,14 +23,11 @@
2323
"dist"
2424
],
2525
"devDependencies": {
26+
"@eslint/js": "^9.0.0",
2627
"@semantic-release/changelog": "^6.0.3",
2728
"@semantic-release/git": "^10.0.1",
2829
"@types/jest": "^29.5.14",
29-
"@typescript-eslint/eslint-plugin": "^8.34.0",
30-
"@typescript-eslint/parser": "^8.34.0",
31-
"eslint": "^9.28.0",
32-
"eslint-config-airbnb-base": "^15.0.0",
33-
"eslint-config-prettier": "^10.1.5",
30+
"eslint": "^9.0.0",
3431
"eslint-plugin-import": "^2.31.0",
3532
"eslint-plugin-prettier": "^5.4.1",
3633
"husky": "^9.1.7",
@@ -39,6 +36,7 @@
3936
"pretty-quick": "^4.2.2",
4037
"semantic-release": "^24.2.5",
4138
"ts-jest": "^29.4.0",
42-
"typescript": "^5.8.3"
39+
"typescript": "^5.8.3",
40+
"typescript-eslint": "^7.0.0"
4341
}
4442
}

renovate.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"groupSlug": "all",
66
"packageRules": [
77
{
8-
"packagePatterns": [ "*" ],
8+
"packagePatterns": ["*"],
99
"groupName": "all dependencies",
1010
"groupSlug": "all"
1111
}

tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@
1111
"types": ["jest"],
1212
"esModuleInterop": true
1313
},
14-
"include": ["src/**/*", "index.ts"]
14+
"include": ["src/**/*", "test/**/*", "index.ts"],
15+
"exclude": ["node_modules", "dist", "coverage"]
1516
}

0 commit comments

Comments
 (0)