Skip to content

Commit

Permalink
Replace tslint with eslint and stylistic (#279)
Browse files Browse the repository at this point in the history
* replace tslint with eslint and stylistic

* apply linting rules

* add EOL

* rename step in workflow
  • Loading branch information
Uzlopak authored Jan 30, 2024
1 parent 9d58799 commit 32f05c1
Show file tree
Hide file tree
Showing 15 changed files with 1,387 additions and 1,680 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ jobs:
run: npx mocha --timeout 30000 -r ts-node/register/type-check test/*-test.ts

lint:
name: Run TSLint
name: Run ESLint
runs-on: ubuntu-latest
steps:
- name: Fetch code
Expand Down
4 changes: 2 additions & 2 deletions bin/build_wasm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ if (!platform && process.argv[2]) {
if (process.argv[2] === '--prebuild') {
const cmd = `docker build --platform=${platform.toString().trim()} -t llhttp_wasm_builder .`;

/* tslint:disable-next-line no-console */
// eslint-disable-next-line no-console
console.log(`> ${cmd}\n\n`);
execSync(cmd, { stdio: 'inherit' });

Expand Down Expand Up @@ -43,7 +43,7 @@ if (process.argv[2] === '--docker') {
}
cmd += ` --mount type=bind,source=${WASM_SRC}/build,target=/home/node/llhttp/build llhttp_wasm_builder npm run wasm`;

/* tslint:disable-next-line no-console */
// eslint-disable-next-line no-console
console.log(`> ${cmd}\n\n`);
execSync(cmd, { cwd: WASM_SRC, stdio: 'inherit' });
process.exit(0);
Expand Down
50 changes: 50 additions & 0 deletions eslint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@stylistic/recommended-extends"
],
"rules": {
"max-len": [
"error",
{
"code": 120
}
],
"no-console": "error",
"@typescript-eslint/no-unused-vars": "error",
"@stylistic/array-bracket-spacing": ["error", "always"],
"@stylistic/operator-linebreak": ["error", "after"],
"@stylistic/brace-style": ["error", "1tbs", { "allowSingleLine": true }],
"@stylistic/member-delimiter-style": ["error", {
"overrides": {
"interface": {
"multiline": {
"delimiter": "semi",
"requireLast": true
}
}
}
}],
"indent": "off",
"@stylistic/indent": ["error", 2, {
"SwitchCase": 1,
"FunctionDeclaration": { "parameters": "first" },
"FunctionExpression": { "parameters": "first" }
}],
"semi": "off",
"@stylistic/semi": ["error", "always"]
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": [
"tsconfig.eslint.json"
],
"sourceType": "module",
"ecmaFeatures": {
"jsx": true,
"modules": true,
"experimentalObjectRestSpread": true
}
}
}
Loading

0 comments on commit 32f05c1

Please sign in to comment.