@nextgis/eslint-config v3.0.0-alpha.13
NextGIS config for Eslint
A Typescript and Javascript configuration for ESLint used in NextGIS frontend projects.
Install
All dependencies are already included in this library so you can not install them separately. Just run the command:
npm i -D @nextgis/eslint-config
Then create the .eslintrc
in the root of your project and add the following content:
{
"extends": [
"@nextgis/eslint-config"
]
}
Webpack
Install eslint loader for webpack
npm i -D eslint-loader
In your webpack configuration
module.exports = {
// ...
module: {
rules: [
{
enforce: "pre",
test: /\.(t|j)sx?$/,
loader: "eslint-loader",
exclude: /node_modules/
},
{
test: /\.js$/,
loader: "babel-loader",
exclude: /node_modules/
},
{
test: /\.tsx?$/,
loader: 'ts-loader',
exclude: /node_modules/
},
]
}
// ...
};
VSCode
To properly set up the environment for checking and automatically fixes *.ts files, follow these steps:
Install VSCode ESLint extension from site or from plugin manager;
Configure project to work with typescript files
Open VSCode File > Preferences > Settings
JSON view
Or create config file manual:
mkdir .vscode && touch .vscode/settings.json
and add this to config:
"editor.formatOnSave": true,
"eslint.autoFixOnSave": true,
"eslint.validate": [
{
"language": "javascript",
"autoFix": true
},
{
"language": "javascriptreact",
"autoFix": true
},
{
"language": "typescript",
"autoFix": true
},
{
"language": "typescriptreact",
"autoFix": true
}
],
"tslint.enable": false
8 months ago
9 months ago
11 months ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago