Skip to content

Commit 330b269

Browse files
committed
eslint
1 parent 481cb54 commit 330b269

File tree

4 files changed

+1636
-23
lines changed

4 files changed

+1636
-23
lines changed

.github/workflows/eslint.yml

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: [ "master" ]
6+
pull_request:
7+
branches: [ "master" ]
8+
9+
jobs:
10+
eslint:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: Setup Node.js
16+
uses: actions/setup-node@v3
17+
with:
18+
node-version: '20'
19+
cache: 'npm'
20+
21+
- name: Install Dependencies
22+
run: npm ci
23+
24+
- name: Run ESLint
25+
run: npm run lint

eslint.config.js

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
// https://eslint.org/docs/latest/use/configure/
2+
// https://eslint.vuejs.org/user-guide/
3+
// https://typescript-eslint.io/rules/?=recommended
4+
5+
import eslint from '@eslint/js';
6+
import eslintConfigPrettier from 'eslint-config-prettier';
7+
import eslintPluginVue from 'eslint-plugin-vue';
8+
import globals from 'globals';
9+
import typescriptEslint from 'typescript-eslint';
10+
11+
export default typescriptEslint.config(
12+
{ ignores: ['*.d.ts', '**/coverage', '**/dist'] },
13+
{
14+
files: ['**/*.js'],
15+
...eslint.configs.recommended,
16+
languageOptions: {
17+
ecmaVersion: 'latest',
18+
sourceType: 'module',
19+
globals: {
20+
...globals.browser,
21+
process: 'readonly',
22+
module: 'readonly',
23+
require: 'readonly',
24+
window: 'readonly',
25+
},
26+
},
27+
},
28+
{
29+
files: ['**/*.{ts,vue}'],
30+
extends: [
31+
eslint.configs.recommended,
32+
...typescriptEslint.configs.recommended,
33+
...eslintPluginVue.configs['flat/recommended'],
34+
],
35+
languageOptions: {
36+
ecmaVersion: 'latest',
37+
globals: {
38+
...globals.browser,
39+
},
40+
sourceType: 'module',
41+
parserOptions: {
42+
parser: typescriptEslint.parser,
43+
},
44+
},
45+
rules: {
46+
'vue/require-default-prop': 'off',
47+
'vue/attribute-hyphenation': 'off',
48+
'vue/multi-word-component-names': 'off',
49+
'vue/block-lang': 'off',
50+
'@typescript-eslint/no-explicit-any': 'off',
51+
},
52+
},
53+
eslintConfigPrettier
54+
);

0 commit comments

Comments
 (0)