Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/robinblomberg/eslint-config-robinblomberg
Strict ESLint rule set for JavaScript, TypeScript, React and JSDoc.
https://github.com/robinblomberg/eslint-config-robinblomberg
eslint
Last synced: 1 day ago
JSON representation
Strict ESLint rule set for JavaScript, TypeScript, React and JSDoc.
- Host: GitHub
- URL: https://github.com/robinblomberg/eslint-config-robinblomberg
- Owner: RobinBlomberg
- Created: 2020-08-22T09:10:45.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-03-23T09:26:57.000Z (10 months ago)
- Last Synced: 2025-01-10T20:14:58.221Z (5 days ago)
- Topics: eslint
- Language: JavaScript
- Homepage:
- Size: 1.37 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ESLint config
## Installation
```sh
npm install -D @robinblomberg/eslint-config-robinblomberg
```## Configuration
Create a file called **.eslintrc.js** at the project root:
```js
module.exports = {
extends: '@robinblomberg/robinblomberg',
};
```## NPM scripts
Add the following scripts to your package.json:
```json
{
"scripts": {
"lint-scripts": "eslint \"**/*.{js,jsx,ts,tsx}\"",
"lint-scripts-fix": "eslint \"**/*.{js,jsx,ts,tsx}\" --fix"
}
}
```Adjust the paths according to your project/file structure as necessary (e.g. `"eslint \"lib/**/*.{ts,tsx}\""`).
To run a script, enter the following in your command line:
```sh
npm run lint-scripts
```## Formatting on save
With this knowledge of ESLint messages in mind, we can modify VS Code to tell ESLint to fix any issues (mainly formatting) every time we save. To open the settings menu, click on the gear icon in the lower left, and then choose **Settings**.
Within the settings menu, search for eslint. In the results, you will see a checkbox for **ESLint: Auto Fix on Save**. Make sure this is checked:
![VS Code Settings](./docs/images/mycmb9lgf1joqvp6r9jq.png)
Now, save your JavaScript file. You should see some changes, including fewer squiggles.