build(websocket): upgrade ESLint to v9 (#30359)
Signed-off-by: hainenber <dotronghai96@gmail.com>
This commit is contained in:
parent
f3e4347a8b
commit
55d9d57112
|
|
@ -1,20 +0,0 @@
|
|||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
# contributor license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright ownership.
|
||||
# The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
# (the "License"); you may not use this file except in compliance with
|
||||
# the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
*.min.js
|
||||
node_modules
|
||||
dist
|
||||
coverage
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
module.exports = {
|
||||
root: true,
|
||||
parser: '@typescript-eslint/parser',
|
||||
env: {
|
||||
node: true,
|
||||
browser: true,
|
||||
},
|
||||
plugins: [
|
||||
'@typescript-eslint',
|
||||
'lodash',
|
||||
],
|
||||
extends: [
|
||||
'eslint:recommended',
|
||||
'plugin:@typescript-eslint/recommended',
|
||||
'prettier',
|
||||
],
|
||||
rules: {
|
||||
"lodash/import-scope": [2, "member"],
|
||||
"@typescript-eslint/explicit-module-boundary-types": 0,
|
||||
"@typescript-eslint/no-var-requires": 0,
|
||||
},
|
||||
};
|
||||
|
|
@ -0,0 +1,53 @@
|
|||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
const typescriptEslintParser = require('@typescript-eslint/parser');
|
||||
const typescriptEslintPlugin = require('@typescript-eslint/eslint-plugin');
|
||||
const typescriptEslint = require('typescript-eslint');
|
||||
const lodashEslintPlugin = require('eslint-plugin-lodash');
|
||||
const eslintConfigPrettier = require('eslint-config-prettier');
|
||||
const js = require('@eslint/js');
|
||||
const globals = require('globals');
|
||||
|
||||
module.exports = [
|
||||
js.configs.recommended,
|
||||
...typescriptEslint.configs.recommended,
|
||||
eslintConfigPrettier,
|
||||
{
|
||||
files: ['**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx'],
|
||||
ignores: ['*.min.js', 'node_modules', 'dist', 'coverage'],
|
||||
languageOptions: {
|
||||
parser: typescriptEslintParser,
|
||||
globals: {
|
||||
...globals.browser,
|
||||
...globals.node,
|
||||
},
|
||||
},
|
||||
plugins: {
|
||||
typescript: typescriptEslintPlugin,
|
||||
lodash: lodashEslintPlugin,
|
||||
},
|
||||
rules: {
|
||||
'lodash/import-scope': [2, 'member'],
|
||||
'@typescript-eslint/explicit-module-boundary-types': 0,
|
||||
'@typescript-eslint/no-var-requires': 0,
|
||||
'@typescript-eslint/no-require-imports': 0, // Re-enable once superset-websocket is converted to ESM
|
||||
},
|
||||
},
|
||||
];
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -7,7 +7,7 @@
|
|||
"start": "node dist/index.js start",
|
||||
"test": "NODE_ENV=test jest -i spec",
|
||||
"type": "tsc --noEmit",
|
||||
"eslint": "eslint --ext .js,.jsx,.ts,.tsx",
|
||||
"eslint": "eslint",
|
||||
"lint": "npm run eslint -- . && npm run type",
|
||||
"dev-server": "ts-node src/index.ts start",
|
||||
"build": "tsc",
|
||||
|
|
@ -17,7 +17,6 @@
|
|||
},
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@types/lodash": "^4.17.7",
|
||||
"cookie": "^0.6.0",
|
||||
"hot-shots": "^10.0.0",
|
||||
"ioredis": "^4.28.0",
|
||||
|
|
@ -28,24 +27,28 @@
|
|||
"ws": "^8.18.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/js": "^9.11.0",
|
||||
"@types/cookie": "^0.6.0",
|
||||
"@types/eslint__js": "^8.42.3",
|
||||
"@types/ioredis": "^4.27.8",
|
||||
"@types/lodash": "^4.17.7",
|
||||
"@types/jest": "^29.5.12",
|
||||
"@types/jsonwebtoken": "^9.0.6",
|
||||
"@types/lodash": "^4.17.7",
|
||||
"@types/node": "^22.0.2",
|
||||
"@types/uuid": "^10.0.0",
|
||||
"@types/ws": "^8.5.12",
|
||||
"@typescript-eslint/eslint-plugin": "^5.62.0",
|
||||
"@typescript-eslint/parser": "^5.62.0",
|
||||
"eslint": "^8.57.0",
|
||||
"@typescript-eslint/eslint-plugin": "^8.6.0",
|
||||
"@typescript-eslint/parser": "^8.6.0",
|
||||
"eslint": "^9.11.0",
|
||||
"eslint-config-prettier": "^9.1.0",
|
||||
"eslint-plugin-lodash": "^7.4.0",
|
||||
"eslint-plugin-lodash": "^8.0.0",
|
||||
"globals": "^15.9.0",
|
||||
"jest": "^29.7.0",
|
||||
"prettier": "^3.3.3",
|
||||
"ts-jest": "^29.2.5",
|
||||
"ts-node": "^10.9.2",
|
||||
"typescript": "^5.5.4"
|
||||
"typescript": "^5.5.4",
|
||||
"typescript-eslint": "^8.6.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^16.9.1",
|
||||
|
|
|
|||
|
|
@ -89,7 +89,10 @@ describe('server', () => {
|
|||
end: endMock,
|
||||
};
|
||||
|
||||
server.httpRequest(request as any, response as any);
|
||||
server.httpRequest(
|
||||
request as unknown as http.IncomingMessage,
|
||||
response as unknown as http.ServerResponse<http.IncomingMessage>,
|
||||
);
|
||||
|
||||
expect(writeHeadMock).toBeCalledTimes(1);
|
||||
expect(writeHeadMock).toHaveBeenLastCalledWith(200);
|
||||
|
|
@ -115,7 +118,10 @@ describe('server', () => {
|
|||
end: endMock,
|
||||
};
|
||||
|
||||
server.httpRequest(request as any, response as any);
|
||||
server.httpRequest(
|
||||
request as unknown as http.IncomingMessage,
|
||||
response as unknown as http.ServerResponse<http.IncomingMessage>,
|
||||
);
|
||||
|
||||
expect(writeHeadMock).toBeCalledTimes(1);
|
||||
expect(writeHeadMock).toHaveBeenLastCalledWith(404);
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ function configFromFile(): Partial<ConfigType> {
|
|||
const configFile = isTest ? '../config.test.json' : '../config.json';
|
||||
try {
|
||||
return require(configFile);
|
||||
} catch (err) {
|
||||
} catch {
|
||||
console.warn('config.json file not found');
|
||||
return {};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@ export type StreamResult = [
|
|||
|
||||
// sync with superset-frontend/src/components/ErrorMessage/types
|
||||
export type ErrorLevel = 'info' | 'warning' | 'error';
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
export type SupersetError<ExtraType = Record<string, any> | null> = {
|
||||
error_type: string;
|
||||
extra: ExtraType;
|
||||
|
|
|
|||
Loading…
Reference in New Issue