Skip to content
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
31 changes: 0 additions & 31 deletions .eslintrc.js

This file was deleted.

2 changes: 1 addition & 1 deletion bench/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as assert from "assert";
import assert from "assert";
import { spawnSync } from "child_process";
import { existsSync } from "fs";
import { resolve } from "path";
Expand Down
2 changes: 0 additions & 2 deletions bin/build_wasm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ if (!platform && process.argv[2]) {
if (process.argv[2] === '--prebuild') {
const cmd = `docker build --platform=${platform.toString().trim()} -t llhttp_wasm_builder .`;

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

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

// eslint-disable-next-line no-console
console.log(`> ${cmd}\n\n`);
execSync(cmd, { cwd: WASM_SRC, stdio: 'inherit' });
process.exit(0);
Expand Down
2 changes: 1 addition & 1 deletion bin/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { dirname, resolve } from 'path';
import { CHeaders, HTTP } from '../src/llhttp';

// https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string
// eslint-disable-next-line max-len
// eslint-disable-next-line @stylistic/js/max-len
const semverRE = /^(?<major>0|[1-9]\d*)\.(?<minor>0|[1-9]\d*)\.(?<patch>0|[1-9]\d*)(?:-(?<prerelease>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?<buildmetadata>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/;

const C_FILE = resolve(__dirname, '../build/c/llhttp.c');
Expand Down
66 changes: 66 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
import stylisticJs from '@stylistic/eslint-plugin-js'
import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';
import globals from 'globals';

export default tseslint.config(
{ ignores: ["lib", "examples", "bench"] },
eslint.configs.recommended,
...tseslint.configs.recommended,
...tseslint.configs.stylistic,
{
"languageOptions": {
"parser": tseslint.parser,
"parserOptions": {
"lib": ["es2023"],
"module": "commonjs",
"moduleResolution": "node",
"target": "es2022",

"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"include": [
"bin/**/*.ts",
"src/**/*.ts",
"test/**/*.ts"
],
"outDir": "./lib",
"declaration": true,
"pretty": true,
"sourceMap": true
},
"globals": {
...globals.commonjs,
...globals.node,
...globals.es6
},
},
},
{
plugins: {
'@stylistic/js': stylisticJs
},
files: [
"bin/**/*.ts",
'bench/**/*.ts',
'src/**/*.ts',
'test/**/*.ts',
],
rules: {
'@stylistic/js/max-len': [ 2, {
'code': 120,
'ignoreComments': true
} ],
"@stylistic/js/array-bracket-spacing": ["error", "always"],
"@stylistic/js/operator-linebreak": ["error", "after"],
"@stylistic/js/linebreak-style": ["error", "unix"],
"@stylistic/js/brace-style": ["error", "1tbs", { "allowSingleLine": true }],
'@stylistic/js/indent': ["error", 2, {
"SwitchCase": 1,
"FunctionDeclaration": { "parameters": "first" },
"FunctionExpression": { "parameters": "first" }
}],
}
}
);
50 changes: 0 additions & 50 deletions eslint.json

This file was deleted.

2 changes: 1 addition & 1 deletion examples/wasm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/
import { readFileSync } from 'fs';
import { resolve } from 'path';
import * as constants from '../build/wasm/constants';
import constants from '../build/wasm/constants';

const bin = readFileSync(resolve(__dirname, '../build/wasm/llhttp.wasm'));
const mod = new WebAssembly.Module(bin);
Expand Down
Loading