Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace tslint with eslint and stylistic #279

Merged
merged 5 commits into from
Jan 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading