-
Notifications
You must be signed in to change notification settings - Fork 188
Developer Guide
Alex X edited this page Aug 24, 2023
·
3 revisions
Example: Windows + PyCharm + ESLint
-
Install NodeJS:
C:\Node2005\
-
Install
eslint
globally
npm install -g eslint
npm install -g eslint-plugin-html
-
Set env
NODE_PATH=c:\Node2005\node_modules\
-
Setup PyCharm: [x] Manual ESLint configuration:
C:\Node2005\node_modules\eslint
-
Add
package.json
to root of your project
{
"devDependencies": {
"eslint": "^8.44.0",
"eslint-plugin-html": "^7.1.0"
},
"eslintConfig": {
"env": {
"browser": true,
"es6": true
},
"parserOptions": {
"ecmaVersion": 2017,
"sourceType": "module"
},
"rules": {
"no-var": "error",
"no-undef": "error",
"no-unused-vars": "warn",
"prefer-const": "error",
"quotes": [
"error",
"single"
],
"semi": "error"
},
"plugins": [
"html"
],
"overrides": [
{
"files": [
"*.html"
],
"parserOptions": {
"sourceType": "script"
}
}
]
}
}