-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature: setup linting and files changed by linting
- Loading branch information
1 parent
8a4e80b
commit c4651e5
Showing
9 changed files
with
856 additions
and
769 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,37 @@ | ||
{ | ||
"parserOptions": { | ||
"ecmaVersion": 2020, | ||
"sourceType": "module", | ||
"requireConfigFile": false | ||
}, | ||
"env": { | ||
"browser": true, | ||
"es6": true, | ||
"node": true, | ||
"jest": true | ||
}, | ||
"rules": { | ||
"no-var": "error", | ||
"prefer-const": "warn", | ||
"no-console": "off", | ||
"no-debugger": "warn", | ||
"no-undef": "error", | ||
"no-unused-vars": "warn", | ||
"quotes": ["error", "single"], | ||
"semi": ["error", "never"], | ||
"new-cap": 2, | ||
"no-caller": 2, | ||
"dot-notation": 0, | ||
"no-eq-null": 2, | ||
"no-unused-expressions": 0, | ||
"curly": 0, | ||
"eqeqeq": 2, | ||
"wrap-iife": [2, "any"], | ||
"no-use-before-define": [ | ||
2, | ||
{ | ||
"functions": false | ||
} | ||
] | ||
} | ||
} |
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,21 +1,49 @@ | ||
name: CI | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
concurrency: | ||
group: ${{ github.ref }} | ||
cancel-in-progress: true | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup NodeJS | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
|
||
- name: Install dependencies | ||
run: npm install --frozen-lockfile | ||
|
||
- name: EsLint | ||
run: npm run lint | ||
|
||
unit-test: | ||
runs-on: ubuntu-latest | ||
needs: lint | ||
concurrency: | ||
group: ${{ github.ref }} | ||
cancel-in-progress: true | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup NodeJS | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18 | ||
- run: | | ||
npm install | ||
npm run test:unit | ||
|
||
- name: Install dependencies | ||
run: npm install --frozen-lockfile | ||
|
||
- name: Unit test | ||
run: npm run test:unit |
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,11 @@ | ||
{ | ||
"singleQuote": true, | ||
"trailingComma": "es5", | ||
"printWidth": 120, | ||
"tabWidth": 4, | ||
"semi": false, | ||
"bracketSpacing": true, | ||
"proseWrap": "always", | ||
"arrowParens": "always", | ||
"htmlWhitespaceSensitivity": "css" | ||
} |
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,4 +1,4 @@ | ||
module.exports = { | ||
presets: ['@babel/preset-env'], | ||
plugins: ['babel-plugin-transform-import-meta'] | ||
plugins: ['babel-plugin-transform-import-meta'], | ||
} |
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 |
---|---|---|
@@ -1,10 +1,10 @@ | ||
module.exports = { | ||
testEnvironment: "node", | ||
testMatch: ["**/__tests__/**/*.js", "**/?(*.)+(spec|test).js"], | ||
moduleFileExtensions: ["js", "json", "jsx", "node"], | ||
testEnvironment: 'node', | ||
testMatch: ['**/__tests__/**/*.js', '**/?(*.)+(spec|test).js'], | ||
moduleFileExtensions: ['js', 'json', 'jsx', 'node'], | ||
collectCoverage: true, | ||
verbose: true, | ||
transform: { | ||
"\\.[j]sx?$": "babel-jest", | ||
} | ||
}; | ||
'\\.[j]sx?$': 'babel-jest', | ||
}, | ||
} |
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.