-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adds eslint and action for lint checking
- Loading branch information
Showing
97 changed files
with
2,859 additions
and
2,024 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Lint AAS Web UI | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- 'aas-web-ui/**' | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: ./aas-web-ui | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '22' | ||
|
||
- name: Install Dependencies | ||
run: yarn install | ||
|
||
- name: Run Linter | ||
run: yarn lint:check |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
import js from '@eslint/js'; | ||
import eslintConfigPrettier from 'eslint-config-prettier'; | ||
import prettier from 'eslint-plugin-prettier'; | ||
import pluginPromise from 'eslint-plugin-promise'; | ||
import simpleImportSort from 'eslint-plugin-simple-import-sort'; | ||
import vue from 'eslint-plugin-vue'; | ||
import ts from 'typescript-eslint'; | ||
|
||
export default [ | ||
{ | ||
ignores: ['{dist,public}/**/*', 'vue-shim.d.ts'], | ||
}, | ||
|
||
{ | ||
languageOptions: { | ||
ecmaVersion: 'latest', | ||
}, | ||
}, | ||
|
||
// js | ||
js.configs.recommended, | ||
|
||
// ts | ||
...ts.configs.recommended, | ||
{ | ||
rules: { | ||
'@typescript-eslint/no-explicit-any': 'warn', | ||
'@typescript-eslint/no-unused-expressions': ['error', { allowTernary: true }], | ||
}, | ||
}, | ||
|
||
// vue | ||
...vue.configs['flat/recommended'], | ||
{ | ||
// files: ['*.vue', '**/*.vue'], | ||
languageOptions: { | ||
parserOptions: { | ||
parser: ts.parser, | ||
}, | ||
}, | ||
}, | ||
{ | ||
rules: { | ||
'vue/multi-word-component-names': 'off', | ||
'vue/no-unused-vars': ['error', { ignorePattern: '^_' }], | ||
'vue/max-attributes-per-line': ['error', { singleline: 5 }], | ||
}, | ||
}, | ||
|
||
// Sort imports | ||
{ | ||
plugins: { | ||
'simple-import-sort': simpleImportSort, | ||
}, | ||
rules: { | ||
'simple-import-sort/imports': [ | ||
'error', | ||
{ | ||
groups: [ | ||
[ | ||
'^\\u0000', // all side effects (0 at start) | ||
'^[^/\\.].*\u0000$', // external types (0 at end) | ||
'^\\..*\u0000$', // internal types (0 at end) | ||
'^@?\\w', // Starts with @ | ||
'^[^.]', // any | ||
'^\\.', // local | ||
], | ||
], | ||
}, | ||
], | ||
'simple-import-sort/exports': 'error', | ||
'@typescript-eslint/no-explicit-any': ['warn', { ignoreRestArgs: true }], | ||
}, | ||
}, | ||
|
||
// Promise | ||
pluginPromise.configs['flat/recommended'], | ||
{ | ||
rules: { | ||
'promise/always-return': 'off', | ||
'promise/catch-or-return': 'off', | ||
}, | ||
}, | ||
|
||
// Prettier | ||
{ | ||
plugins: { | ||
prettier, | ||
}, | ||
rules: { | ||
'prettier/prettier': 'error', | ||
}, | ||
}, | ||
|
||
// Disable rules that conflict with Prettier | ||
eslintConfigPrettier, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.