-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(bridge-ui): add eslint to the pipeline (#13444)
- Loading branch information
1 parent
81ba617
commit 58f6430
Showing
19 changed files
with
197 additions
and
69 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -13,7 +13,7 @@ jobs: | |
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Cancel Previous Runs | ||
- name: Cancel previous runs | ||
uses: styfle/[email protected] | ||
with: | ||
access_token: ${{ github.token }} | ||
|
@@ -24,11 +24,19 @@ jobs: | |
- name: Install pnpm dependencies | ||
uses: ./.github/actions/install-pnpm-dependencies | ||
|
||
- name: Bridge UI - Unit Tests | ||
- name: Svelte check | ||
working-directory: ./packages/bridge-ui | ||
run: pnpm svelte:check | ||
|
||
- name: Linting | ||
working-directory: ./packages/bridge-ui | ||
run: pnpm lint | ||
|
||
- name: Unit tests | ||
working-directory: ./packages/bridge-ui | ||
run: pnpm test | ||
|
||
- name: Bridge UI - Upload coverage to Codecov | ||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
directory: ./packages/bridge-ui/coverage | ||
|
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,7 @@ | ||
dist | ||
build | ||
coverage | ||
node_modules | ||
example | ||
LICENSES | ||
public |
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,94 @@ | ||
module.exports = { | ||
env: { | ||
node: true, | ||
browser: true, | ||
es2021: true, | ||
webextensions: true, | ||
}, | ||
extends: ['eslint:recommended'], | ||
parser: '@typescript-eslint/parser', | ||
parserOptions: { | ||
ecmaVersion: 'latest', | ||
sourceType: 'module', | ||
extraFileExtensions: ['.svelte'], | ||
}, | ||
plugins: ['svelte3', '@typescript-eslint' /*, 'simple-import-sort'*/], | ||
rules: { | ||
'linebreak-style': ['error', 'unix'], | ||
// 'simple-import-sort/imports': 'error', | ||
// 'simple-import-sort/exports': 'error', | ||
semi: ['error', 'always'], | ||
'no-console': ['error', { allow: ['warn', 'error'] }], | ||
}, | ||
ignorePatterns: ['node_modules'], // todo: lets lint that separately, or move it to its own package | ||
settings: { | ||
'svelte3/typescript': require('typescript'), | ||
}, | ||
overrides: [ | ||
{ | ||
files: ['*.ts', '*.svelte'], | ||
extends: [ | ||
'plugin:@typescript-eslint/recommended', | ||
'plugin:@typescript-eslint/recommended-requiring-type-checking', | ||
], | ||
parserOptions: { | ||
project: ['./tsconfig.json'], | ||
tsconfigRootDir: __dirname, | ||
}, | ||
rules: { | ||
'@typescript-eslint/no-inferrable-types': 'off', | ||
'@typescript-eslint/unbound-method': 'off', | ||
'@typescript-eslint/no-empty-interface': 'off', | ||
|
||
// TODO: fix all these errors and turn back on these rules | ||
'@typescript-eslint/no-unsafe-member-access': 'off', | ||
'@typescript-eslint/no-unsafe-call': 'off', | ||
'@typescript-eslint/no-unsafe-assignment': 'off', | ||
'@typescript-eslint/no-unsafe-return': 'off', | ||
'@typescript-eslint/no-unsafe-argument': 'off', | ||
'@typescript-eslint/restrict-template-expressions': 'off', | ||
'@typescript-eslint/no-misused-promises': 'off', | ||
'@typescript-eslint/no-floating-promises': 'off', | ||
'@typescript-eslint/ban-ts-comment': 'off', | ||
}, | ||
}, | ||
{ | ||
files: ['*.svelte'], | ||
processor: 'svelte3/svelte3', | ||
// typescript and svelte dont work with template handlers yet. | ||
// https://stackoverflow.com/questions/63337868/svelte-typescript-unexpected-tokensvelteparse-error-when-adding-type-to-an-ev | ||
// we need these 3 rules to be able to do: | ||
// on:change=(e) => anyFunctionHere(). | ||
// when svelte is updated, we can remove these 5 rules for svelte files. | ||
rules: { | ||
'@typescript-eslint/no-explicit-any': 'off', | ||
'@typescript-eslint/no-implicit-any': 'off', | ||
'@typescript-eslint/no-unsafe-assignment': 'off', | ||
'@typescript-eslint/no-unsafe-member-access': 'off', | ||
'@typescript-eslint/no-unsafe-argument': 'off', | ||
'@typescript-eslint/no-unsafe-call': 'off', | ||
'@typescript-eslint/restrict-template-expressions': [ | ||
'warn', | ||
{ | ||
allowNumber: true, | ||
allowBoolean: true, | ||
allowNullish: true, | ||
allowAny: true, | ||
}, | ||
], | ||
}, | ||
}, | ||
{ | ||
files: ['*.spec.ts'], | ||
plugins: ['jest'], | ||
rules: { | ||
'@typescript-eslint/no-explicit-any': 'off', | ||
'@typescript-eslint/no-empty-function': 'off', | ||
'@typescript-eslint/no-unused-vars': 'off', | ||
'@typescript-eslint/no-unsafe-assignment': 'off', | ||
'@typescript-eslint/unbound-method': 'off', | ||
'jest/unbound-method': 'error', | ||
}, | ||
}, | ||
], | ||
}; |
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,6 @@ | ||
{ | ||
"**/*.{js,ts,svelte}": [ | ||
"pnpm prettier:write", | ||
"pnpm lint:fix" | ||
] | ||
} |
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 |
---|---|---|
|
@@ -5,3 +5,7 @@ node_modules | |
example | ||
LICENSES | ||
public | ||
.gitignore | ||
.eslintignore | ||
.lintstagedrc | ||
.prettierignore |
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
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.