Shared ESLint and Typescript configuration
Integrate into new project
- Turn off VS code extention "Prettier" for the project if you use it
- Create file .vscode/settings.json
- add
"prettier.enable": false to the json
- Install this package as devDependency
$ npm i -D @super-protocol/eslint-config-typescript
- Install peer dependencies of this package in your project as devDependencies
Therefore, you can make use of the tool install-peerdeps:
$ npx install-peerdeps --dev @super-protocol/eslint-config-typescript
- Use ESLint config in your project
Create a .eslintrc.js file in project root with the following data:
module.exports = {
extends: '@super-protocol/eslint-config-typescript/eslint-config.js',
};
- Use Typescript config in your project
Create tsconfig.json file in project root with the following data:
{
"extends": "./node_modules/@super-protocol/eslint-config-typescript/tsconfig.json",
"compilerOptions": {
"outDir": "dist"
},
"include": ["src", "test"],
"exclude": [],
}
include and exclude properties should correspond to your project's folders structure