Skip to content

Commit

Permalink
Switch from ESLint to Rome (#145)
Browse files Browse the repository at this point in the history
karniv00l authored Dec 1, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 4723c17 commit 4000cf7
Showing 11 changed files with 439 additions and 9,706 deletions.
1 change: 0 additions & 1 deletion .eslintignore

This file was deleted.

50 changes: 0 additions & 50 deletions .eslintrc.yml

This file was deleted.

2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -15,8 +15,6 @@ npm-debug.log*
yarn-debug.log*
yarn-error.log*

.eslintcache

# # temp test data
# /test/data/tmp/*
# !/test/data/tmp/.keep
5 changes: 3 additions & 2 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -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 changes: 15 additions & 5 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
9,433 changes: 128 additions & 9,305 deletions package-lock.json

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -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 changes: 27 additions & 0 deletions rome.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
}
}
10 changes: 7 additions & 3 deletions src/cli.ts
Original file line number Diff line number Diff line change
@@ -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;
}
579 changes: 250 additions & 329 deletions src/ini.ts

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/parserInterface.ts
Original file line number Diff line number Diff line change
@@ -3,5 +3,5 @@ export interface ParserInterface {
}

export interface ParserConstructor {
new(buffer: ArrayBuffer): ParserInterface;
new (buffer: ArrayBuffer): ParserInterface;
}

0 comments on commit 4000cf7

Please sign in to comment.