-
Notifications
You must be signed in to change notification settings - Fork 22
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 #759 from bitpredator/dev
fix + refactor: fixed textui bug + Improved code style, respecting ESLint rules
- Loading branch information
Showing
72 changed files
with
4,773 additions
and
3,521 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,23 @@ | ||
name: ESLint | ||
|
||
on: | ||
push: | ||
branches: [ "main", "dev" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
jobs: | ||
eslint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 16 | ||
- run: npm ci # or yarn install | ||
- uses: sibiraj-s/action-eslint@v3 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} # optional | ||
eslint-args: '--ignore-pattern=.gitignore --quiet' | ||
extensions: 'js,jsx,ts,tsx' | ||
annotations: true |
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,50 @@ | ||
const js = require('@eslint/js'); | ||
|
||
module.exports = [ | ||
js.configs.recommended, | ||
{ | ||
languageOptions: { | ||
ecmaVersion: 'latest', | ||
}, | ||
rules: { | ||
'arrow-spacing': ['warn', { 'before': true, 'after': true }], | ||
'brace-style': ['error', 'stroustrup', { 'allowSingleLine': true }], | ||
'comma-dangle': ['error', 'always-multiline'], | ||
'comma-spacing': 'error', | ||
'comma-style': 'error', | ||
'curly': ['error', 'multi-line', 'consistent'], | ||
'dot-location': ['error', 'property'], | ||
'handle-callback-err': 'off', | ||
'indent': ['error', 'tab'], | ||
'keyword-spacing': 'error', | ||
'max-nested-callbacks': ['error', { 'max': 4 }], | ||
'max-statements-per-line': ['error', { 'max': 2 }], | ||
'no-console': 'off', | ||
'no-empty-function': 'error', | ||
'no-floating-decimal': 'error', | ||
'no-inline-comments': 'error', | ||
'no-lonely-if': 'error', | ||
'no-multi-spaces': 'error', | ||
'no-multiple-empty-lines': ['error', { 'max': 2, 'maxEOF': 1, 'maxBOF': 0 }], | ||
'no-shadow': ['error', { 'allow': ['err', 'resolve', 'reject'] }], | ||
'no-trailing-spaces': ['error'], | ||
'no-var': 'error', | ||
'no-undef': 'off', | ||
'object-curly-spacing': ['error', 'always'], | ||
'prefer-const': 'error', | ||
'quotes': ['error', 'single'], | ||
'semi': ['error', 'always'], | ||
'space-before-blocks': 'error', | ||
'space-before-function-paren': ['error', { | ||
'anonymous': 'never', | ||
'named': 'never', | ||
'asyncArrow': 'always', | ||
}], | ||
'space-in-parens': 'error', | ||
'space-infix-ops': 'error', | ||
'space-unary-ops': 'error', | ||
'spaced-comment': 'error', | ||
'yoda': '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,8 @@ | ||
import globals from 'globals'; | ||
import pluginJs from '@eslint/js'; | ||
|
||
|
||
export default [ | ||
{ languageOptions: { globals: globals.browser } }, | ||
pluginJs.configs.recommended, | ||
]; |
Oops, something went wrong.