Skip to content

Commit

Permalink
Merge pull request #759 from bitpredator/dev
Browse files Browse the repository at this point in the history
fix + refactor:  fixed textui bug + Improved code style, respecting ESLint rules
  • Loading branch information
bitpredator authored Jul 31, 2024
2 parents 0d69694 + 80d0dbb commit 5097360
Show file tree
Hide file tree
Showing 72 changed files with 4,773 additions and 3,521 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/ESlint.yml
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
50 changes: 50 additions & 0 deletions eslint.config.js
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',
},
},
];
8 changes: 8 additions & 0 deletions eslint.config.mjs
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,
];
Loading

0 comments on commit 5097360

Please sign in to comment.