eslint-config-murmuration
v0.1.13
Published
## Author
Downloads
6
Readme
eslint-config-murmuration
Author
- Harry Stephens
Installation
Then, install eslint-config with npm
npm install --save-dev eslint-config-murmuration
Setup
From wherever you installed eslint-config-murmuration
, run:
sh node_modules/eslint-config-murmuration/setup.sh
Ensure that your IDE has the ESLint plugin installed, turned on, using automatic settings in either VS Code or WebStorm.
Visual Studio Code
Verify that ESLint is running by navigating to the Preferences: Open Settings (UI)
and make sure the following settings are as follows:
Editor: Default Formatter
is set to ESLintEditor: Format On Save
box is tickedEslint: Enable
box is tickedEslint > Format: Enable
box is ticked
WebStorm
Open Preferences and navigate to Languages & Frameworks | JavaScript | Code Quality Tools | ESLint
, then set ESLint to Automatic ESLint Configuration
.
Make sure the Run eslint --fix on save
box is ticked.
Running from the Command Line
eslint ./DIRECTORY_TO_LINT --ext .ts --config .eslintrc.js --fix
Verify Setup
Double check that ESLint is working as expected by creating a new TypeScript file and pasting the following function in it:
// You should get all sorts of errors here.
let myTestFunction = (myTestString) => {
myTestString = [
"ESLint should be very upset",
"about every aspect of this function"
]
return myTestString
}
// If you replace the above code with:
const myTestFunction = (myTestString: Array<string>): string => {
myTestString = [
'ESLint should be very upset',
'about every aspect of this function',
];
return myTestString[0];
};
myTestFunction(['This should make', 'ESLint happy']);
// All warnings and errors should disappear
Lint your little heart out.