-
-
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.
feat(eslint): split ESLint config into specialised parts (#19)
Resolves #14 ## 📑 Description Split the ESLint config into specialized parts. For now, we use "base", "next" and "react" as separated configurations. Base is the default. ##⚠️ BREAKING CHANGE The default config is now only "base", instead of all of them. ## ✏️ Side Note To ignore the `.changeset` folder from prettier, I added a custom ignore file.
- Loading branch information
Showing
11 changed files
with
126 additions
and
49 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
# Changesets | ||
|
||
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works | ||
with multi-package repos, or single-package repos to help you version and publish your code. You can | ||
find the full documentation for it [in our repository](https://github.com/changesets/changesets) | ||
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works with multi-package | ||
repos, or single-package repos to help you version and publish your code. You can find the full documentation for it | ||
[in our repository](https://github.com/changesets/changesets) | ||
|
||
We have a quick list of common questions to get you started engaging with this project in | ||
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md) |
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,5 @@ | ||
--- | ||
"@mheob/eslint-config": patch | ||
--- | ||
|
||
Improve README to get a better copy/paste experience. |
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,5 @@ | ||
--- | ||
"@mheob/eslint-config": major | ||
--- | ||
|
||
Split ESLint configuration into specified files (base/reat/next for now). |
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,11 @@ | ||
# Changeset | ||
.changeset | ||
|
||
# dependencies | ||
node_modules | ||
|
||
# testing | ||
coverage | ||
|
||
# turbo | ||
.turbo |
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,4 @@ | ||
module.exports = { | ||
extends: ['./base.js'], | ||
env: { node: true }, | ||
}; |
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
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 @@ | ||
module.exports = require('./base'); |
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 @@ | ||
/** | ||
* NextJS specific ESLint rules | ||
* @type {import('eslint').ESLint.ConfigData} | ||
*/ | ||
module.exports = { | ||
extends: ['./react', 'next/core-web-vitals'], | ||
}; |
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 |
---|---|---|
|
@@ -16,13 +16,16 @@ | |
"author": "Alexander Böhm <[email protected]>", | ||
"main": "index.cjs", | ||
"files": [ | ||
"index.cjs", | ||
"index.js", | ||
"base.js", | ||
"next.js", | ||
"react.js", | ||
"LICENSE", | ||
"README.md" | ||
], | ||
"scripts": { | ||
"clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist", | ||
"lint": "TIMING=1 eslint src/**/*.ts* --fix" | ||
"lint": "TIMING=1 eslint **/*.cjs --fix" | ||
}, | ||
"dependencies": { | ||
"@typescript-eslint/eslint-plugin": "^5.35.1", | ||
|
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,24 @@ | ||
/** | ||
* React specific ESLint rules | ||
* @type {import('eslint').ESLint.ConfigData} | ||
*/ | ||
module.exports = { | ||
extends: ['./base', 'plugin:eslint-plugin-react/recommended'], | ||
settings: { | ||
react: { | ||
version: 'detect', | ||
}, | ||
}, | ||
overrides: [ | ||
{ | ||
files: ['*.jsx', '*.tsx'], | ||
settings: { react: { version: 'detect' } }, | ||
rules: { | ||
'react/jsx-curly-brace-presence': ['warn', { props: 'never', children: 'never' }], | ||
'react/jsx-no-useless-fragment': 'warn', | ||
'react/react-in-jsx-scope': 'off', | ||
'unicorn/filename-case': ['error', { case: 'pascalCase' }], | ||
}, | ||
}, | ||
], | ||
}; |