-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch to new flat config for eslint v9
- Loading branch information
Showing
8 changed files
with
181 additions
and
203 deletions.
There are no files selected for viewing
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 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,62 @@ | ||
import eslint from "@eslint/js"; | ||
import prettierPlugin from "eslint-plugin-prettier/recommended"; | ||
import reactPluginRecommended from "eslint-plugin-react/configs/recommended.js"; | ||
import reactPluginJsxRuntime from "eslint-plugin-react/configs/jsx-runtime.js"; | ||
import globals from "globals"; | ||
|
||
const defaultConfig = [ | ||
eslint.configs.recommended, | ||
prettierPlugin, | ||
{ | ||
languageOptions: { | ||
globals: { | ||
...globals.browser, | ||
...globals.node, | ||
}, | ||
parserOptions: { | ||
ecmaVersion: 2023, | ||
sourceType: "module", | ||
}, | ||
}, | ||
rules: { | ||
curly: ["warn", "multi-line", "consistent"], | ||
"no-console": process.env.NODE_ENV === "production" ? "error" : "warn", | ||
"no-debugger": process.env.NODE_ENV === "production" ? "error" : "warn", | ||
}, | ||
}, | ||
]; | ||
|
||
const reactConfig = [ | ||
defaultConfig, | ||
reactPluginRecommended, | ||
reactPluginJsxRuntime, | ||
{ | ||
languageOptions: { | ||
parserOptions: { | ||
ecmaVersion: 2023, | ||
}, | ||
}, | ||
settings: { | ||
react: { | ||
version: "detect", | ||
}, | ||
}, | ||
rules: { | ||
"react/prop-types": 0, | ||
}, | ||
}, | ||
]; | ||
|
||
const plugin = { | ||
// We have to repeat the information from our package.json. [see](https://eslint.org/docs/latest/extend/plugin-migration-flat-config#adding-plugin-meta-information) | ||
meta: { | ||
name: "@tree-company/eslint-config", | ||
version: "0.3.2", | ||
}, | ||
configs: { | ||
default: defaultConfig, | ||
react: reactConfig, | ||
}, | ||
}; | ||
|
||
export default plugin; |
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 |
---|---|---|
|
@@ -4,18 +4,23 @@ | |
"version": "0.3.2", | ||
"repository": "[email protected]:tree-company/developer-handbook", | ||
"author": "Tree company <[email protected]>", | ||
"contributors": ["Robbe Van Petegem <[email protected]>"], | ||
"contributors": [ | ||
"Robbe Van Petegem <[email protected]>" | ||
], | ||
"license": "MIT", | ||
"main": "default.js", | ||
"type": "module", | ||
"scripts": {}, | ||
"dependencies": { | ||
"@eslint/js": "^9.2.0", | ||
"eslint-config-prettier": "^9.1.0", | ||
"eslint-plugin-prettier": "^5.1.3", | ||
"eslint-plugin-react": "^7.34.1" | ||
"eslint-plugin-react": "^7.34.1", | ||
"globals": "^15.1.0" | ||
}, | ||
"devDependencies": {}, | ||
"peerDependencies": { | ||
"eslint": "^8.56.0", | ||
"prettier": "^3.2.4" | ||
"eslint": "^9.2.0", | ||
"prettier": "^3.2.5" | ||
} | ||
} |
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,3 @@ | ||
import config from "./eslint-config/index.js"; | ||
|
||
export default config.configs.default; |
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 |
---|---|---|
|
@@ -7,22 +7,18 @@ | |
"author": "Tree company <[email protected]>", | ||
"contributors": ["Robbe Van Petegem <[email protected]>"], | ||
"license": "MIT", | ||
"type": "module", | ||
"private": true, | ||
"workspaces": [ | ||
"eslint-config", | ||
"stylelint-config" | ||
], | ||
"scripts": { | ||
"lint": "yarn lint:js", | ||
"lint:js": "eslint . --ext js --fix" | ||
"lint:js": "eslint . --fix" | ||
}, | ||
"devDependencies": { | ||
"eslint": "^8.57.0", | ||
"eslint": "^9.2.0", | ||
"prettier": "^3.2.5" | ||
}, | ||
"eslintConfig": { | ||
"extends": [ | ||
"./eslint-config/default.js" | ||
] | ||
} | ||
} |
Oops, something went wrong.