Skip to content

Commit

Permalink
switch from jshint to eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
copy committed Jul 1, 2024
1 parent 904da13 commit 49477e9
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 32 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ on:
pull_request:

jobs:
jshint:
name: JSHint
eslint:
name: eslint
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Run JSHint
run: sudo npm install -g jshint; make jshint
- name: Run eslint
run: sudo npm install -g eslint; make eslint

test:
runs-on: ubuntu-latest
Expand Down
25 changes: 0 additions & 25 deletions .jshint.json

This file was deleted.

6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -317,12 +317,12 @@ api-tests: all-debug
./tests/api/floppy-insert-eject.js
./tests/api/serial.js

all-tests: jshint kvm-unit-test qemutests qemutests-release jitpagingtests api-tests nasmtests nasmtests-force-jit tests expect-tests
all-tests: eslint kvm-unit-test qemutests qemutests-release jitpagingtests api-tests nasmtests nasmtests-force-jit tests expect-tests
# Skipping:
# - devices-test (hangs)

jshint:
jshint --config=./.jshint.json src tests gen lib
eslint:
eslint src tests gen lib examples

rustfmt: $(RUST_FILES)
cargo fmt --all -- --check --config fn_single_line=true,control_brace_style=ClosingNextLine
Expand Down
74 changes: 74 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
export default [
{
rules: {
"semi": "error",
//"no-var": "error",
"radix": "error",
"comma-style": ["error", "last"],
//"comma-dangle": ["error", "always-multiline"],
"no-sequences": "error",
//"one-var": ["error", "never"],
"constructor-super": "error",
"for-direction": "error",
"getter-return": "error",
"no-async-promise-executor": "error",
//"no-case-declarations": "error",
"no-class-assign": "error",
"no-compare-neg-zero": "error",
"no-cond-assign": "error",
"no-const-assign": "error",
"no-constant-binary-expression": "error",
//"no-constant-condition": "error",
//"no-control-regex": "error",
//"no-debugger": "error",
"no-delete-var": "error",
"no-dupe-args": "error",
"no-dupe-class-members": "error",
//"no-dupe-else-if": "error",
"no-dupe-keys": "error",
"no-duplicate-case": "error",
//"no-empty": "error",
"no-empty-character-class": "error",
"no-empty-pattern": "error",
"no-empty-static-block": "error",
"no-ex-assign": "error",
"no-extra-boolean-cast": "error",
"no-fallthrough": "error",
"no-func-assign": "error",
"no-global-assign": "error",
"no-import-assign": "error",
"no-invalid-regexp": "error",
"no-irregular-whitespace": "error",
"no-loss-of-precision": "error",
"no-misleading-character-class": "error",
"no-new-native-nonconstructor": "error",
"no-nonoctal-decimal-escape": "error",
"no-obj-calls": "error",
"no-octal": "error",
"no-prototype-builtins": "error",
//"no-redeclare": "error",
"no-regex-spaces": "error",
"no-self-assign": "error",
"no-setter-return": "error",
"no-shadow-restricted-names": "error",
"no-sparse-arrays": "error",
"no-this-before-super": "error",
//"no-undef": "error",
"no-unexpected-multiline": "error",
//"no-unreachable": "error",
"no-unsafe-finally": "error",
"no-unsafe-negation": "error",
"no-unsafe-optional-chaining": "error",
"no-unused-labels": "error",
"no-unused-private-class-members": "error",
//"no-unused-vars": "error",
"no-useless-backreference": "error",
"no-useless-catch": "error",
//"no-useless-escape": "error",
"no-with": "error",
"require-yield": "error",
"use-isnan": "error",
"valid-typeof": "error"
}
}
];

0 comments on commit 49477e9

Please sign in to comment.