Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: eslint config #10

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions known_issues.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Known Issues

## eslint-config-react

### Plugin "react-hooks" was conflicted \[...\]

When configuring NextJS alongside the settings in the package `@plutotcool/eslint-config-react`, an error arises due to both using the same extended configuration from eslint-config-react-hooks ('plugin:react-hooks/recommended').

To resolve this issue, it is recommended to adjust the `extends` rule in the `.eslintrc` file of the Next Project as follows:

`"extends": ["@plutotcool/eslint-config-react", "next/core-web-vitals"]`

placing `next/core-web-vitals` as the second extension.

However, this solution introduces a potential problem with conflicting overridden rules. For instance, if `"react-hooks/exhaustive-deps": "error"` is specified in `@plutotcool/eslint-config-react`, it may still trigger a warning instead of an error, as `react-hooks/exhaustive-deps` is set to warn.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"devDependencies": {
"@changesets/changelog-github": "^0.5.0",
"@changesets/cli": "^2.27.1",
"prettier": "^3.1.1",
"turbo": "^1.11.1"
}
}
7 changes: 7 additions & 0 deletions packages/eslint-config-core/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": ["eslint:recommended", "plugin:prettier/recommended"],
"plugins": ["prettier"],
"rules": {
"prettier/prettier": "warn"
}
}
29 changes: 29 additions & 0 deletions packages/eslint-config-core/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name": "@plutotcool/eslint-config-core",
"version": "1.0.0",
"description": "Base eslint core configuration for plutot.cool projects.",
"main": ".eslintrc.json",
"repository": "plutotcool/configurations",
"homepage": "https://github.com/plutotcool/configurations/tree/main/packages/eslint-config-core#readme",
"license": "MIT",
"author": "Bastien Robert <[email protected]>",
"contributors": [
"Julien Dargelos <[email protected]>"
],
"publishConfig": {
"access": "public"
},
"keywords": [
"eslint",
"plutotcool"
],
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"peerDependencies": {
"eslint": "^8",
"eslint-config-prettier": "^9",
"eslint-plugin-prettier": "^5",
"prettier": "^3"
}
}
27 changes: 27 additions & 0 deletions packages/eslint-config-core/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# ESlint core configuration

> Base eslint configuration for plutot.cool projects.

## Installation

```bash
npx install-peerdeps -P -D @plutotcool/eslint-config-core
```

In `.eslintrc`

```json
{
"extends": "@plutotcool/eslint-config-core"
}
```

In `package.json`

```json
{
"scripts": {
"lint": "eslint ."
}
}
```
12 changes: 12 additions & 0 deletions packages/eslint-config-react/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"extends": [
"@plutotcool/eslint-config-typescript",
"plugin:react/recommended",
"plugin:react-hooks/recommended"
],
"plugins": ["react", "react-hooks"],
"rules": {
"react/no-children-prop": "error",
"react-hooks/exhaustive-deps": "error"
}
}
31 changes: 31 additions & 0 deletions packages/eslint-config-react/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"name": "@plutotcool/eslint-config-react",
"version": "1.0.0",
"description": "Base eslint react configuration for plutot.cool projects.",
"main": ".eslintrc.json",
"repository": "plutotcool/configurations",
"homepage": "https://github.com/plutotcool/configurations/tree/main/packages/eslint-config-react#readme",
"license": "MIT",
"author": "Bastien Robert <[email protected]>",
"contributors": [
"Julien Dargelos <[email protected]>"
],
"publishConfig": {
"access": "public"
},
"keywords": [
"eslint",
"react",
"plutotcool"
],
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"dependencies": {
"@plutotcool/eslint-config-typescript": "^1.0.0"
},
"peerDependencies": {
"eslint-plugin-react": "^7",
"eslint-plugin-react-hooks": "^4.5"
}
}
27 changes: 27 additions & 0 deletions packages/eslint-config-react/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# ESlint react configuration

> Base eslint configuration for plutot.cool projects using react.

## Installation

```bash
npx install-peerdeps -P -D @plutotcool/eslint-config-react
```

In `.eslintrc`

```json
{
"extends": "@plutotcool/eslint-config-react"
}
```

In `package.json`

```json
{
"scripts": {
"lint": "eslint . --ext .ts,.tsx"
}
}
```
18 changes: 18 additions & 0 deletions packages/eslint-config-typescript/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"extends": [
"@plutotcool/eslint-config-core",
"plugin:@typescript-eslint/recommended"
],
"plugins": ["@typescript-eslint"],
"parser": "@typescript-eslint/parser",
"rules": {
"@typescript-eslint/no-unused-vars": [
"warn",
{
"argsIgnorePattern": "^_",
"varsIgnorePattern": "^_",
"caughtErrorsIgnorePattern": "^_"
}
]
}
}
31 changes: 31 additions & 0 deletions packages/eslint-config-typescript/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"name": "@plutotcool/eslint-config-typescript",
"version": "1.0.0",
"description": "Base eslint typescript configuration for plutot.cool projects.",
"main": ".eslintrc.json",
"repository": "plutotcool/configurations",
"homepage": "https://github.com/plutotcool/configurations/tree/main/packages/eslint-config-typescript#readme",
"license": "MIT",
"author": "Bastien Robert <[email protected]>",
"contributors": [
"Julien Dargelos <[email protected]>"
],
"publishConfig": {
"access": "public"
},
"keywords": [
"eslint",
"typescript",
"plutotcool"
],
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"dependencies": {
"@plutotcool/eslint-config-core": "^1.0.0"
},
"peerDependencies": {
"@typescript-eslint/eslint-plugin": "^6",
"@typescript-eslint/parser": "^6"
}
}
27 changes: 27 additions & 0 deletions packages/eslint-config-typescript/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# ESlint typescript configuration

> Base eslint configuration for plutot.cool projects using Typescript.

## Installation

```bash
npx install-peerdeps -P -D @plutotcool/eslint-config-typescript
```

In `.eslintrc`

```json
{
"extends": "@plutotcool/eslint-config-typescript"
}
```

In `package.json`

```json
{
"scripts": {
"lint": "eslint . --ext .ts,.tsx"
}
}
```
Loading