@anrom/eslint-config
v1.0.1
Published
## Installation
Downloads
51
Readme
@anrom/eslint-config
Installation
Note: You may already have this configured by a scaffolder. Check the presence of
.eslintrc.yamlin your directory and@anrom/eslint-configinpackage.json->devDependencies
Install @anrom/eslint-config as a development dependency:
npm i -D @anrom/eslint-configCreate an
.eslintrc.yamlfile in your project root with the following contents:extends: - '@anrom'If you're updating an old repository that has a production-level project, please also use "legacy" rules. In this case your
.eslintrc.yamlfile should have this content:extends: - '@anrom' - '@anrom/eslint-config/legacy'
Updating
Whenever an update is going to be released for this package - developers will be notified. To update the package to the latest version, run
npm i -D @anrom/eslint-config@latestIn case of any other breaking changes that will require you to make any additional steps - they will be mentioned in this section in the latest version of this manual. It will always have the following URL: https://www.npmjs.com/package/@anrom/eslint-config
IDE Settings
JetBrains IDEs (WebStorm, IntelliJ IDEA)
Open IDE settings (
⌘+,in macOS orCtrl+Alt+Sin Windows/Linux)Go to
Languages & Frameworks > JavaScript > Code Quality Tools > ESLintor just type "esl" in search bar:Select "Automatic ESLint configuration" and check the box "Run eslint --fix" on save":
Save the configuration.
To ensure that config was applied, go to any of your .js, .mjs or .jsx file in
./srcfolder, type in any code that causes ESLint error or warning and ensure it's highlighted. For example current configuration softly discourages developers from using plainconsole.log:
Visual Studio Code
Go to VS Marketplace and install ESLint extension by clicking "Install" button and then allowing the browser to open VS Code and clicking "Install" again on the extension's page
Restart VS Code
Open your settings.json file. The quickest way to open this file is to enter search (either
F1or⌘+Shift+P / Ctrl+Shift+P) ane enter "user json" - you will see a suggestion "Preferences: Open User Settings (JSON)"Add the following code to your
Settings.json:"editor.codeActionsOnSave": { "source.fixAll.eslint": true }To ensure that config was applied, go to any of your .js, .mjs or .jsx file in
./srcfolder, type in any code that causes ESLint error or warning and ensure it's highlighted. For example current configuration softly discourages developers from declaring unused variables:
