-
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: configure ESLint to new configuration including tests
- Loading branch information
Showing
7 changed files
with
205 additions
and
35 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import globals from "globals"; | ||
import eslint from "@eslint/js"; | ||
import tseslint from "typescript-eslint"; | ||
import tsParser from "@typescript-eslint/parser"; | ||
|
||
export default tseslint.config( | ||
{ | ||
files: ["**/*.ts"], | ||
languageOptions: { | ||
parser: tsParser, | ||
parserOptions: { | ||
project: "./tsconfig.json", | ||
}, | ||
}, | ||
plugins: { | ||
"@typescript-eslint": tseslint, | ||
}, | ||
rules: { | ||
...eslint.configs.recommended.rules, // Include recommended JS rules | ||
...tseslint.configs.recommended.rules, // Include recommended TS rules | ||
}, | ||
}, | ||
{ | ||
languageOptions: { | ||
globals: { ...globals.browser, ...globals.node, ...globals.jest }, | ||
}, | ||
}, | ||
{ | ||
// Global ignore patterns | ||
ignores: [ | ||
"dist", | ||
"docs", | ||
".yarn", | ||
"node_modules", | ||
"**/node_modules", | ||
"src/schemas", | ||
"coverage", | ||
"*.config.mjs", | ||
"jest.config.ts", | ||
], | ||
} | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ | |
"types": "dist/main.d.ts", | ||
"scripts": { | ||
"prepack": "yarn run build", | ||
"build": "tsc", | ||
"build": "tsc -p tsconfig.build.json", | ||
"build:docs": "typedoc src/main.ts", | ||
"commitmsg": "commitlint -quiet=0 --extends=@commitlint/config-conventional -e", | ||
"precommit": "standard `git diff --name-only --staged --relative | grep '.js$'`", | ||
|
@@ -20,7 +20,8 @@ | |
"api:folksonomy": "openapi-typescript https://api.folksonomy.openfoodfacts.org/openapi.json --output src/schemas/folksonomy.ts", | ||
"api:nutripatrol": "openapi-typescript https://nutripatrol.openfoodfacts.org/api/openapi.json --output src/schemas/nutripatrol.ts", | ||
"check": "yarn run lint && yarn run test", | ||
"lint": "prettier --check . && eslint .", | ||
"lint": "eslint .", | ||
"lint:fix": "eslint --fix .", | ||
"format": "prettier --write .", | ||
"fix": "standard --fix", | ||
"test": "jest", | ||
|
@@ -56,20 +57,24 @@ | |
"devDependencies": { | ||
"@commitlint/cli": "^19.3.0", | ||
"@commitlint/config-conventional": "^19.2.2", | ||
"@eslint/eslintrc": "^3.1.0", | ||
"@eslint/js": "^9.13.0", | ||
"@jest/globals": "^29.7.0", | ||
"@types/jest": "^29.5.14", | ||
"@types/node": "^22.8.5", | ||
"@typescript-eslint/eslint-plugin": "^7.0.0", | ||
"@typescript-eslint/parser": "^7.8.0", | ||
"eslint": "^9.1.1", | ||
"formdata-node": "^6.0.3", | ||
"globals": "^15.11.0", | ||
"jest": "^29.7.0", | ||
"openapi-typescript": "^6.7.4", | ||
"prettier": "^3.1.1", | ||
"ts-jest": "^29.2.5", | ||
"ts-node": "^10.9.2", | ||
"typedoc": "^0.26.10", | ||
"typescript": "^5.6.3" | ||
"typescript": "^5.6.3", | ||
"typescript-eslint": "^8.12.2" | ||
}, | ||
"packageManager": "[email protected]" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"extends": "./tsconfig.json", | ||
"compilerOptions": { | ||
"rootDir": "./src" | ||
}, | ||
"include": ["src"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.