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

test: use oxlint instead of eslint #519

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
6 changes: 0 additions & 6 deletions .eslintrc

This file was deleted.

7 changes: 2 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"url": "git://github.com/node-modules/urllib.git"
},
"scripts": {
"lint": "eslint src test --ext .ts --cache",
"lint": "oxlint",
"prebuild": "npm run clean",
"build": "tsc --version && tshy && tshy-after && npm run build:version",
"postbuild": "rm -rf *.tsbuildinfo",
Expand Down Expand Up @@ -54,8 +54,6 @@
"devDependencies": {
"@arethetypeswrong/cli": "^0.15.3",
"@eggjs/tsconfig": "^1.3.3",
"@tsconfig/node18": "^18.2.1",
"@tsconfig/strictest": "^2.0.2",
"@types/busboy": "^1.5.0",
"@types/mime-types": "^2.1.1",
"@types/node": "^20.2.1",
Expand All @@ -66,9 +64,8 @@
"@vitest/coverage-v8": "^1.6.0",
"busboy": "^1.6.0",
"cross-env": "^7.0.3",
"eslint": "8",
"eslint-config-egg": "13",
"iconv-lite": "^0.6.3",
"oxlint": "^0.5.0",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tip

Codebase Verification

Remove residual eslint references.

Ensure that all references to eslint are removed or updated in the following files to avoid conflicts with the new oxlint setup:

  • src/HttpAgent.ts
  • src/HttpClient.ts
  • test/cjs/index.js
Analysis chain

Check for residual eslint references.

Ensure that all references to eslint and related configurations are removed from the project to avoid conflicts with the new oxlint setup.

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Search for residual eslint references.

# Test: Search for eslint references. Expect: No occurrences.
rg --type json --type js --type ts 'eslint'

Length of output: 260

"proxy": "^1.0.2",
"selfsigned": "^2.0.1",
"tar-stream": "^2.2.0",
Expand Down
1 change: 0 additions & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ const JSONCtlCharsMap: Record<string, string> = {
'\r': '\\r', // \u000d
'\t': '\\t', // \u0009
};
/* eslint no-control-regex: "off"*/
const JSONCtlCharsRE = /[\u0000-\u001F\u005C]/g;

function replaceOneChar(c: string) {
Expand Down
1 change: 0 additions & 1 deletion test/mts/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"extends": ["@tsconfig/strictest/tsconfig", "@tsconfig/node18/tsconfig"],
"compilerOptions": {
"allowSyntheticDefaultImports": true,
"outDir": "dist",
Expand Down
2 changes: 1 addition & 1 deletion test/options.dataType.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ describe('options.dataType.test.ts', () => {
}, (err: any) => {
// console.error(err);
assert.equal(err.name, 'JSONResponseFormatError');
assert.match(err.message, /\" \.\.\.skip\.\.\. \"/);
assert.match(err.message, /" \.\.\.skip\.\.\. "/);
assert.equal(err.res.status, 200);
assert.equal(err.res.headers['content-type'], 'application/json');
return true;
Expand Down
2 changes: 1 addition & 1 deletion test/options.fixJSONCtlChars.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ describe('options.fixJSONCtlChars.test.ts', () => {
assert.equal(response.status, 200);
// console.log(response.data);
assert.deepEqual(response.data, {
foo: '\b\f\n\r\tbar\u000e!1!\u0086!2\!\u0000\!3\!\u001f\!4\!\\\!5\!end\\\\',
foo: '\b\f\n\r\tbar\u000e!1!\u0086!2!\u0000!3!\u001f!4!\\\!5!end\\\\',
});
});

Expand Down
2 changes: 1 addition & 1 deletion test/user-agent.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ describe('keep-alive-header.test.ts', () => {
});
assert.equal(response.status, 200);
// console.log(response.data.headers);
assert.match(response.data.headers['user-agent'], /^node\-urllib\/VERSION Node\.js\/\d+\.\d+\.\d+ \(/);
assert.match(response.data.headers['user-agent'], /^node-urllib\/VERSION Node\.js\/\d+\.\d+\.\d+ \(/);
});

it('should return no user agent if user-agent header is set to empty string', async () => {
Expand Down
Loading