Skip to content

Commit

Permalink
chore(config): update own eslint config, prepare for typescript
Browse files Browse the repository at this point in the history
  • Loading branch information
fmauNeko committed Dec 9, 2024
1 parent 0f6f314 commit 53ae877
Show file tree
Hide file tree
Showing 7 changed files with 203 additions and 42 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules
.turbo
dist
155 changes: 135 additions & 20 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"turbo": "latest"
},
"engines": {
"node": ">=16.0.0"
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
},
"packageManager": "[email protected]"
}
18 changes: 0 additions & 18 deletions packages/backend/.eslintrc.js

This file was deleted.

30 changes: 30 additions & 0 deletions packages/backend/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import eslint from '@eslint/js';
import eslintPlugin from 'eslint-plugin-eslint-plugin';
import nodePlugin from 'eslint-plugin-n';
import prettierPluginRecommended from "eslint-plugin-prettier/recommended";
import globals from "globals";
import tseslint from 'typescript-eslint';

export default tseslint.config(
eslint.configs.recommended,
tseslint.configs.recommended,
nodePlugin.configs["flat/recommended"],
eslintPlugin.configs['flat/recommended'],
{
languageOptions: {
globals: {
...globals.nodeBuiltin,
...globals.es2023
}
}
},
{
files: ['tests/**/*.js'],
languageOptions: {
globals: {
...globals.mocha
}
}
},
prettierPluginRecommended
);
11 changes: 8 additions & 3 deletions packages/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,13 @@
"kuzzle"
],
"author": "The Kuzzle Team",
"type": "module",
"main": "lib/index.js",
"scripts": {
"lint": "eslint lib",
"test": "mocha tests --recursive"
"lint": "eslint",
"test": "mocha tests --recursive",
"clean": "rimraf dist",
"build": "npm run clean && tsc --build"
},
"peerDependencies": {
"eslint": "^9.10.0",
Expand All @@ -33,13 +36,15 @@
"@eslint/js": "^9.16.0",
"eslint-plugin-jest": "^28.9.0",
"eslint-plugin-prettier": "^5.2.1",
"globals": "^15.13.0",
"prettier": "^3.4.2",
"typescript-eslint": "^8.17.0"
},
"devDependencies": {
"eslint-plugin-eslint-plugin": "^6.3.2",
"eslint-plugin-n": "^17.14.0",
"mocha": "^11.0.1",
"rimraf": "^6.0.1",
"typescript": "~5.7.0"
},
"license": "Apache-2.0",
Expand All @@ -49,6 +54,6 @@
"package.json"
],
"engines": {
"node": ">=16.0.0"
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
}
}
28 changes: 28 additions & 0 deletions packages/backend/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"compilerOptions": {
"lib": ["es2023"],
"module": "node16",
"target": "es2022",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"moduleResolution": "node16",
"allowUnusedLabels": false,
"allowUnreachableCode": false,
"exactOptionalPropertyTypes": true,
"noFallthroughCasesInSwitch": true,
"noImplicitOverride": true,
"noImplicitReturns": true,
"noPropertyAccessFromIndexSignature": true,
"noUncheckedIndexedAccess": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"isolatedModules": true,
"checkJs": true,
"outDir": "./dist",
"sourceMap": true,
"baseUrl": "./lib"
},
"include": ["./lib"]
}

0 comments on commit 53ae877

Please sign in to comment.