0.0.1 • Published 1 year ago
eslint-config-scott v0.0.1
eslint-config-scott
Author
- Harry Stephens
Installation
Then, install eslint-config with npm
npm install eslint-config-scott
Setup
From wherever you installed eslint-config-scott
, run:
sh node_modules/eslint-config-scott/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.
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.
0.0.1
1 year ago