-
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.
Merge pull request #1 from VicSolWang/dev
Dev
- Loading branch information
Showing
14 changed files
with
289 additions
and
93 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
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,73 @@ | ||
# A workflow of VICSOLWANG's project | ||
|
||
name: test-release-ci | ||
|
||
on: | ||
push: | ||
branches: [ master, dev ] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
jobs: | ||
test: | ||
strategy: | ||
matrix: | ||
node_version: ['12', '14', '16'] | ||
os: [ubuntu-latest, windows-latest, macOS-latest] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- if: matrix.os == 'windows-latest' | ||
run: git config --global core.autocrlf false | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: ${{ matrix.node_version }} | ||
- uses: actions/cache@v2 | ||
id: cache-node_modules | ||
with: | ||
path: node_modules | ||
key: ${{ matrix.os }}-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ matrix.os }}-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }} | ||
- run: node --version | ||
- run: npm --version | ||
- run: npm install | ||
- run: npm test | ||
- run: npm run cover:report | ||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: coverage | ||
path: coverage.lcov | ||
|
||
codecov: | ||
runs-on: ubuntu-latest | ||
needs: | ||
- test | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/download-artifact@v2 | ||
with: | ||
name: coverage | ||
- uses: codecov/codecov-action@v2 | ||
|
||
release: | ||
needs: test | ||
runs-on: ubuntu-latest | ||
if: github.event_name == 'push' && github.ref_name == 'master' | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: 16 | ||
- run: npm install is-ci | ||
- uses: cycjimmy/semantic-release-action@v2 | ||
id: semantic | ||
with: | ||
extra_plugins: | | ||
@semantic-release/changelog | ||
@semantic-release/git | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
- if: steps.semantic.outputs.new_release_published == 'true' | ||
run: echo ${{ steps.semantic.outputs.new_release_version }} |
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Logs | ||
/logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# Package lock | ||
package-lock.json | ||
yarn.lock | ||
|
||
# Husky directory | ||
.husky | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage* | ||
|
||
# nyc test coverage | ||
.nyc_output | ||
|
||
# Github directory | ||
.github | ||
|
||
# Dependency directories | ||
node_modules/ | ||
|
||
# IDE / Editor | ||
.idea | ||
.vscode | ||
|
||
# macOS | ||
.DS_Store |
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,29 +1,32 @@ | ||
# Logs | ||
/logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# Package lock | ||
package-lock.json | ||
yarn.lock | ||
|
||
# Husky directory | ||
.husky | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
|
||
# nyc test coverage | ||
.nyc_output | ||
|
||
# Dependency directories | ||
node_modules/ | ||
|
||
# IDE / Editor | ||
.idea | ||
.vscode | ||
|
||
# macOS | ||
.DS_Store | ||
# Logs | ||
/logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# Package lock | ||
package-lock.json | ||
yarn.lock | ||
|
||
# Husky directory | ||
.husky | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage* | ||
|
||
# nyc test coverage | ||
.nyc_output | ||
|
||
# Github directory | ||
.github | ||
|
||
# Dependency directories | ||
node_modules/ | ||
|
||
# IDE / Editor | ||
.idea | ||
.vscode | ||
|
||
# macOS | ||
.DS_Store |
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,21 @@ | ||
{ | ||
"plugins": [ | ||
"@semantic-release/commit-analyzer", | ||
"@semantic-release/release-notes-generator", | ||
[ | ||
"@semantic-release/changelog", | ||
{ | ||
"changelogFile": "docs/CHANGELOG.md" | ||
} | ||
], | ||
"@semantic-release/npm", | ||
"@semantic-release/github", | ||
[ | ||
"@semantic-release/git", | ||
{ | ||
"assets": ["docs/CHANGELOG.md", "package.json"], | ||
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}" | ||
} | ||
] | ||
] | ||
} |
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 |
---|---|---|
@@ -1,31 +1,33 @@ | ||
# eslint-config-wzx-react | ||
|
||
[![NPM version](https://img.shields.io/npm/v/eslint-config-wzx-react)](https://www.npmjs.com/package/eslint-config-wzx-react) | ||
[![node](https://img.shields.io/node/v/eslint-config-wzx-react)](https://nodejs.org) | ||
[![Build Status](https://travis-ci.com/VicSolWang/eslint-config-wzx-react.svg?branch=master)](https://travis-ci.com/VicSolWang/eslint-config-wzx-react) | ||
[![codecov](https://codecov.io/gh/VicSolWang/eslint-config-wzx-react/branch/master/graph/badge.svg)](https://codecov.io/gh/VicSolWang/eslint-config-wzx-react) | ||
[![NPM downloads](https://img.shields.io/npm/dt/eslint-config-wzx-react)](https://www.npmjs.com/package/eslint-config-wzx-react) | ||
[![NPM version](https://img.shields.io/npm/v/eslint-config-wzx-react?logo=npm&style=flat-square)](https://www.npmjs.com/package/eslint-config-wzx-react) | ||
[![node](https://img.shields.io/node/v/eslint-config-wzx-react?logo=nodedotjs&style=flat-square)](https://nodejs.org) | ||
[![Code Style](https://img.shields.io/badge/code%20style-prettier-ff69b4?logo=prettier&style=flat-square)](https://prettier.io) | ||
[![GitHub Workflow Status (branch)](https://img.shields.io/github/workflow/status/VicSolWang/eslint-config-wzx-react/test-release-ci/master?logo=github&style=flat-square)](https://github.com/VicSolWang/eslint-config-wzx-react/actions/workflows/test-release.yml) | ||
[![release](https://img.shields.io/badge/release-semantic--release-e10079?logo=semantic-release&style=flat-square)](https://github.com/semantic-release/semantic-release) | ||
[![codecov](https://img.shields.io/codecov/c/gh/VicSolWang/eslint-config-wzx-react/master?label=codecov&logo=codecov&style=flat-square)](https://codecov.io/gh/VicSolWang/eslint-config-wzx-react) | ||
[![NPM downloads](https://img.shields.io/npm/dt/eslint-config-wzx-react?style=flat-square)](https://www.npmjs.com/package/eslint-config-wzx-react) | ||
|
||
The custom react eslint rules based on [eslint-config-airbnb](https://www.npmjs.com/package/eslint-config-airbnb). (Support Typescript Eslint) | ||
> The custom react eslint rules based on [eslint-config-airbnb](https://www.npmjs.com/package/eslint-config-airbnb). (Support Typescript Eslint) | ||
# Installation | ||
## :cd: Installation | ||
|
||
npm install --save-dev eslint-config-wzx-react | ||
|
||
Note: Typescript eslint needs to install [typescript](https://www.npmjs.com/package/typescript), [@typescript-eslint/parser](https://www.npmjs.com/package/@typescript-eslint/parser), [@typescript-eslint/eslint-plugin](https://www.npmjs.com/package/@typescript-eslint/eslint-plugin). | ||
:bulb: Typescript eslint needs to install [typescript](https://www.npmjs.com/package/typescript), [@typescript-eslint/parser](https://www.npmjs.com/package/@typescript-eslint/parser), [@typescript-eslint/eslint-plugin](https://www.npmjs.com/package/@typescript-eslint/eslint-plugin). | ||
|
||
npm install --save-dev typescript @typescript-eslint/parser @typescript-eslint/eslint-plugin | ||
|
||
# Usage | ||
## :rocket: Usage | ||
|
||
Add eslint-config-wzx-react to the "extends" in your `.eslintrc.* file`. | ||
|
||
{ | ||
"extends": "wzx-react" | ||
} | ||
|
||
Note: Typescript eslint needs `tsconfig.json` in your project root directory. | ||
:bulb: Typescript eslint needs `tsconfig.json` in your project root directory. | ||
|
||
# License | ||
## :lock: License | ||
|
||
[MIT](LICENSE). |
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,9 @@ | ||
/** | ||
* Created by VICSOLWANG. | ||
* Date: 2021/12/23 23:19 | ||
* Email: [email protected] | ||
*/ | ||
|
||
export default { | ||
files: ['test/test.js'], | ||
}; |
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/** | ||
* Created by VICSOLWANG. | ||
* Date: 2021/12/23 23:24 | ||
* Email: [email protected] | ||
*/ | ||
|
||
let a = 'eslint'; | ||
|
||
// 'global-require': 'warn' | ||
if (a) { | ||
require('eslint'); | ||
} | ||
|
||
// 'import/no-dynamic-require': 'warn' | ||
require(a); | ||
|
||
// 'no-bitwise': 'off' | ||
a = 1 & 2; | ||
|
||
// 'no-nested-ternary': 'off' | ||
a = a < 1 ? 0 : a < 2 ? 1 : 2; | ||
|
||
// 'no-script-url': 'warn' | ||
a = 'javascript:void(0)'; | ||
|
||
// 'no-underscore-dangle': 'off' | ||
const _b = () => {}; | ||
_b(); |
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,8 @@ | ||
/** | ||
* Created by VICSOLWANG. | ||
* Date: 2021/12/23 23:24 | ||
* Email: [email protected] | ||
*/ | ||
|
||
const a = (): void => {}; | ||
a(); |
Oops, something went wrong.