@caiocezarqueiroz/eslint-config
Version:
The package @caiocezarqueiroz/eslint-config offers default ESLint configurations, integration with Prettier, EditorConfig, and the VSCode workspace, thus simplifying the development process and ensuring code consistency and compliance with best programmin
94 lines (72 loc) • 2.46 kB
Markdown
# ESLINT Config

[](LICENSE)
[](https://github.com/ccqueiroz/eslint)
[](https://npm-stat.com/charts.html?package=eslint-config)
## Default configs
<ul>
<li>Eslint configs recommended</li>
<li>Typescript-Eslint configs recommended</li>
<li>Prettier</li>
<li>Jest recommended</li>
<li>Vscode workspace settings for code formatting</li>
<li>Editorconfig settings</li>
</ul>
## How to use?
### 1. Install the dependencies
<pre>
npm install eslint jest @types/jest @caiocezarqueiroz/eslint-config --save-dev
or
yarn add eslint jest @types/jest @caiocezarqueiroz/eslint-config -D
</pre>
### 2. To use the <code>eslint</code> and <code>prettier</code>
#### 2.1. Create a <code>.eslintrc.json</code> file extending the config:
<pre>
{
"extends": "@caiocezarqueiroz/eslint-config/settingsGenerator/eslint/node.js"
}
</pre>
#### 2.2. Add the <code>.prettier</code> command in the package.json scripts
<pre>
{
"create-prettier-config": "node ./node_modules/@caiocezarqueiroz/eslint-config/settingsGenerator/prettier/index.js"
}
</pre>
#### 2.3. Run the <code>.prettier</code> command in the terminal with npm or yarn.
<pre>
{
npm run create-prettier-config
or
yarn create-prettier-config
}
</pre>
### 3. To use <code>vscode workspace</code> settings
#### 3.1. Add the <code>create-workspace-vscode</code> command in the package.json scripts.
<pre>
{
"create-workspace-vscode": "node ./node_modules/@caiocezarqueiroz/eslint-config/settingsGenerator/vscode/index.js"
}
</pre>
#### 3.2. Run the <code>create-workspace-vscode</code> command in the terminal with npm or yarn.
<pre>
{
npm run create-workspace-vscode
or
yarn create-workspace-vscode
}
</pre>
### 4. To use <code>.editorconfig</code> settings
#### 4.1. Add the <code>.editorconfig</code> command in the package.json scripts.
<pre>
{
"create-editor-config": "node ./node_modules/@caiocezarqueiroz/eslint-config/settingsGenerator/editorconfig/index.js"
}
</pre>
#### 4.2. Run the <code>.editorconfig</code> command in the terminal with npm or yarn.
<pre>
{
npm run create-editor-config
or
yarn create-editor-config
}
</pre>