This repository has been archived by the owner on Apr 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add typescript * fix * fin * actions * actions
- Loading branch information
Showing
36 changed files
with
19,862 additions
and
18,160 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 |
---|---|---|
@@ -0,0 +1,97 @@ | ||
module.exports = { | ||
root: true, | ||
extends: [ | ||
'plugin:@typescript-eslint/recommended', | ||
'plugin:react-hooks/recommended', | ||
'plugin:ssr-friendly/recommended', | ||
'plugin:prettier/recommended' | ||
], | ||
parser: '@typescript-eslint/parser', | ||
parserOptions: { | ||
ecmaFeatures: { | ||
jsx: true, | ||
}, | ||
ecmaVersion: 2018, | ||
sourceType: 'module', | ||
project: './tsconfig.json', | ||
}, | ||
plugins: ['import', 'prettier', '@typescript-eslint', 'ssr-friendly'], | ||
rules: { | ||
/** | ||
* Allow empty arrow functions `() => {}`, while keeping other empty functions restricted | ||
* @see https://eslint.org/docs/latest/rules/no-empty-function#allow-arrowfunctions | ||
*/ | ||
'@typescript-eslint/no-empty-function': ['error', { allow: ['arrowFunctions'] }], | ||
'@typescript-eslint/ban-ts-comment': 1, | ||
'no-const-assign': 'error', | ||
/** Restrict imports from devDependencies since they are not included in library build. peerDependencies are ok */ | ||
'import/no-extraneous-dependencies': [ | ||
'error', | ||
{ | ||
devDependencies: false, | ||
peerDependencies: true | ||
} | ||
], | ||
/** | ||
* Enforce import order with empty lines between import group | ||
* @see https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/order.md | ||
*/ | ||
'import/order': [ | ||
'error', | ||
{ | ||
groups: [ | ||
'builtin', | ||
'external', | ||
'internal', | ||
['parent', 'sibling', 'index'] | ||
], | ||
pathGroups: [ | ||
{ | ||
pattern: '@/**', | ||
group: 'internal' | ||
} | ||
], | ||
'newlines-between': 'always' | ||
} | ||
], | ||
/** | ||
* Disallow combined module and type imports like this `import React, {FC} from 'react'`. | ||
* Eslint will try to split into type and module imports instead | ||
* @see https://typescript-eslint.io/rules/consistent-type-imports/ | ||
*/ | ||
'@typescript-eslint/consistent-type-imports': 'error', | ||
'import/no-cycle': 'error', | ||
'prettier/prettier': ['error', { | ||
"semi": true, | ||
"singleQuote": true, | ||
"jsxSingleQuote": false, | ||
"trailingComma": "es5", | ||
"bracketSpacing": false, | ||
"jsxBracketSameLine": true, | ||
"arrowParens": "avoid" | ||
}] | ||
}, | ||
overrides: [ | ||
{ | ||
/* Allow devDependencies imports for tests and config files */ | ||
files: ['*.js'], | ||
rules: { | ||
'@typescript-eslint/no-var-requires': 0, | ||
}, | ||
}, | ||
{ | ||
/* Allow devDependencies imports for tests and config files */ | ||
files: ['**/*.spec.*', '**/testUtils/*.*', '**/*.js', '**/setupTests.ts'], | ||
rules: { | ||
'import/no-extraneous-dependencies': [ | ||
'error', | ||
{ | ||
devDependencies: true, | ||
peerDependencies: true, | ||
}, | ||
], | ||
}, | ||
}, | ||
], | ||
}; | ||
// @typescript-eslint/no-var-requires |
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 |
---|---|---|
|
@@ -14,6 +14,9 @@ jobs: | |
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: pnpm/action-setup@v2 | ||
with: | ||
version: 8 | ||
- name: Cancel Workflow Action | ||
uses: styfle/[email protected] | ||
with: | ||
|
@@ -25,10 +28,10 @@ jobs: | |
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ steps.nvm.outputs.NVMRC }} | ||
cache: 'yarn' | ||
cache: 'pnpm' | ||
- name: Run yarn tasks | ||
run: | | ||
yarn install --frozen-lockfile | ||
pnpm install | ||
- name: Publish NPM package | ||
uses: JS-DevTools/npm-publish@v1 | ||
with: | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,9 @@ jobs: | |
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: pnpm/action-setup@v2 | ||
with: | ||
version: 8 | ||
- name: Cancel Workflow Action | ||
uses: styfle/[email protected] | ||
with: | ||
|
@@ -27,13 +30,13 @@ jobs: | |
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ steps.nvm.outputs.NVMRC }} | ||
cache: 'yarn' | ||
- name: Run yarn tasks | ||
cache: 'pnpm' | ||
- name: Run tasks | ||
run: | | ||
yarn install --frozen-lockfile | ||
yarn lint:js --quiet | ||
yarn lint:style --quiet | ||
yarn test --silent | ||
yarn start --smoke-test | ||
yarn start:docs --smoke-test --quiet | ||
yarn build:lib:local --silent | ||
pnpm install | ||
pnpm run lint:js --quiet | ||
pnpm run lint:style --quiet | ||
pnpm run test --silent | ||
pnpm run start --smoke-test | ||
pnpm run start:docs --smoke-test --quiet | ||
# yarn build:lib:local --silent |
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 |
---|---|---|
|
@@ -2,3 +2,4 @@ | |
. "$(dirname "$0")/_/husky.sh" | ||
|
||
npx lint-staged | ||
npm run lint:tsc |
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"*.js": [ | ||
"eslint --fix --quiet" | ||
"*.{js,ts,tsx}": [ | ||
"eslint --fix" | ||
], | ||
"*.css": [ | ||
"stylelint --fix --quiet" | ||
|
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 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
Oops, something went wrong.