Switch from ESLint to Rome (#145)

This commit is contained in:
Piotr Rogowski 2022-12-01 22:51:23 +01:00 committed by GitHub
parent 4723c17887
commit 4000cf725d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 404 additions and 9671 deletions

View File

@ -1 +0,0 @@
/dist

View File

@ -1,50 +0,0 @@
---
parser: '@typescript-eslint/parser'
env:
node: true
es6: true
settings:
import/resolver:
node:
extensions:
- ".js"
- ".ts"
extends:
- eslint:recommended
- prettier
- plugin:import/errors
- plugin:import/warnings
- plugin:import/typescript
plugins:
- '@typescript-eslint'
- prettier
- modules-newline
rules:
indent: [2, 2, { "SwitchCase": 1 }]
semi:
- error
- always
comma-dangle:
- error
- always-multiline
import/extensions: 0
object-curly-spacing:
- error
- always
object-curly-newline: [1, {
"ImportDeclaration": { "multiline": true, "minProperties": 2 },
"ExportDeclaration": { "multiline": true, "minProperties": 1 }
}]
modules-newline/import-declaration-newline: 1
modules-newline/export-declaration-newline: 1
quotes:
- error
- single
no-console: 0
no-plusplus: 0
import/no-extraneous-dependencies: 0
no-undef: 1
no-unused-vars: 0
'@typescript-eslint/no-unused-vars': 1
no-shadow: 0
'@typescript-eslint/no-shadow': 2

2
.gitignore vendored
View File

@ -15,8 +15,6 @@ npm-debug.log*
yarn-debug.log*
yarn-error.log*
.eslintcache
# # temp test data
# /test/data/tmp/*
# !/test/data/tmp/.keep

View File

@ -3,7 +3,8 @@
// for the documentation about the extensions.json format
"recommendations": [
"editorconfig.editorconfig",
"dbaeumer.vscode-eslint",
"davidanson.vscode-markdownlint"
"davidanson.vscode-markdownlint",
"streetsidesoftware.code-spell-checker",
"rome.rome"
]
}

20
.vscode/settings.json vendored
View File

@ -1,7 +1,17 @@
{
"typescript.tsdk": "node_modules/typescript/lib",
"cSpell.words": [
"hypertuner",
"rusefi"
]
"typescript.tsdk": "node_modules/typescript/lib",
"cSpell.words": [
"hypertuner",
"rusefi"
],
"editor.formatOnSave": true,
"[jsonc]": {
"editor.defaultFormatter": "vscode.json-language-features"
},
"[typescript]": {
"editor.defaultFormatter": "rome.rome"
},
"[javascript]": {
"editor.defaultFormatter": "rome.rome"
}
}

9365
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -19,21 +19,21 @@
"build": "tsc",
"prepare": "npm run build",
"start": "tsc --watch",
"lint": "tsc && eslint --max-warnings=0 src/**/*.ts src/*.ts",
"generate": "npm run build && node test/test.js generate",
"test": "npm run build && node test/test.js",
"generate": "npm run build && node test/test.js generate"
"lint": "tsc && rome ci src",
"lint:fix": "rome format --write src && rome check --apply src",
"lint:fix:suggested": "rome check --apply-suggested src"
},
"devDependencies": {
"@hyper-tuner/eslint-config": "^0.1.7",
"@types/js-yaml": "^4.0.5",
"@types/node": "^18.11.9",
"@types/node": "^18.11.10",
"@types/parsimmon": "^1.10.6",
"eslint-plugin-modules-newline": "^0.0.6",
"eslint-plugin-prettier": "^4.2.1",
"typescript": "^4.8.4"
"rome": "^10.0.1",
"typescript": "^4.9.3"
},
"dependencies": {
"@hyper-tuner/types": "^0.4.1",
"@hyper-tuner/types": "^0.4.2",
"js-yaml": "^4.1.0",
"parsimmon": "^1.18.1"
}

27
rome.json Normal file
View File

@ -0,0 +1,27 @@
{
"formatter": {
"enabled": true,
"indentStyle": "space",
"lineWidth": 100,
"indentSize": 2,
"ignore": [
"node_modules",
"build"
]
},
"javascript": {
"formatter": {
"quoteStyle": "single",
"trailingComma": "all"
}
},
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"style": {
"noImplicitBoolean": "off"
}
}
}
}

View File

@ -48,7 +48,7 @@ if (!command) {
}
switch (command) {
case Commands.VALIDATE:
case Commands.VALIDATE: {
if (!filename) {
console.info('❗️ Please provide a file name');
showUsage();
@ -57,13 +57,17 @@ switch (command) {
showVersion();
validate(filename);
break;
}
case Commands.VERSION:
case Commands.VERSION: {
showVersion();
break;
}
default:
console.info(`❗️ Unknown command: ${command}, please use one of: [${Object.values(Commands).join(', ')}]`);
console.info(
`❗️ Unknown command: ${command}, please use one of: [${Object.values(Commands).join(', ')}]`,
);
process.exit(1);
break;
}

File diff suppressed because it is too large Load Diff

View File

@ -3,5 +3,5 @@ export interface ParserInterface {
}
export interface ParserConstructor {
new(buffer: ArrayBuffer): ParserInterface;
new (buffer: ArrayBuffer): ParserInterface;
}