Skip to content

Commit 4bebcb4

Browse files
authored
Add eslint (#294)
* Add eslint * Add eslint github action
1 parent b5a919e commit 4bebcb4

File tree

6 files changed

+1325
-23
lines changed

6 files changed

+1325
-23
lines changed

.github/workflows/eslint.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: ESLint
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- master
8+
- 'dev*'
9+
pull_request:
10+
branches:
11+
- main
12+
- master
13+
- 'dev*'
14+
15+
jobs:
16+
eslint:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v4
20+
- name: Use Node.js
21+
uses: actions/setup-node@v3
22+
with:
23+
node-version: lts/*
24+
- run: npm ci
25+
- run: npm run lint

eslint.config.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import globals from 'globals'
2+
import pluginJs from '@eslint/js'
3+
import tseslint from 'typescript-eslint'
4+
import pluginVue from 'eslint-plugin-vue'
5+
6+
export default [
7+
{
8+
files: ['src/**/*.{js,mjs,cjs,ts,vue}']
9+
},
10+
{
11+
ignores: [
12+
'src/scripts/*',
13+
'src/extensions/core/*',
14+
'src/types/vue-shim.d.ts'
15+
]
16+
},
17+
{ languageOptions: { globals: globals.browser } },
18+
pluginJs.configs.recommended,
19+
...tseslint.configs.recommended,
20+
...pluginVue.configs['flat/essential'],
21+
{
22+
files: ['src/**/*.vue'],
23+
languageOptions: { parserOptions: { parser: tseslint.parser } }
24+
},
25+
{
26+
rules: {
27+
'@typescript-eslint/no-explicit-any': 'off',
28+
'@typescript-eslint/no-unused-vars': 'off',
29+
'@typescript-eslint/prefer-as-const': 'off'
30+
}
31+
}
32+
]

0 commit comments

Comments
 (0)