@josundt/eslint-config v5.8.0
@josundt/eslint-config
ESLint ruleset including required ESLint plugins for josundt TypeScript projects
Usage
Make sure you have installed and configured
@josundt/prettier-configfirstInstall this package
npm install @josundt/eslint-configCreate an
eslint.config.jsfile in the root directory of your project with approximately the following content:import tsBrowserConfig from "@josundt/eslint-config/ts-browser"; import tsJestBrowserConfig from "@josundt/eslint-config/ts-jest-browser"; // When the project has JEST tests const config = [ { ...tsBrowserConfig, files: ["src/**/*.ts"] }, { ...tsJestBrowserConfig, files: ["test/**/?(*.)+(spec).ts?(x)"] } ]; // Otherwise const config = { ...tsBrowserConfig, files: ["src/**/*.ts"] }; export default config;All configurations:
["@josundt/eslint-config/ts-browser"](for browser environment code).["@josundt/eslint-config/ts-node"](for node environment code).["@josundt/eslint-config/ts-jest-browser"](for Jest tests for browser environment code).["@josundt/eslint-config/ts-jest-node"](for Jest tests for node environment code).
Add
lint:tsscript to your project's package.json file:{ // ... "scripts": { // ... "lint:ts": "eslint src test --format visualstudio" // ... } // ... }Test the script:
npm run lint:tsTask in Visual Studio Code:
- Add the following to
.vscode/tasks.json:
{ //... "tasks": [ //... { "label": "lint:ts", "type": "shell", "command": "npx", "args": ["eslint", "src", "test", "-f", "stylish"], "group": "build", "problemMatcher": "$eslint-stylish" }, //... ] //... }- Add the following to
Live Code Analysis in Visual Studio Code:
- Install extension for VSCode: ESLint (dbaeumer.vscode-eslint)
9 months ago
11 months ago
11 months ago
8 months ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 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
6 years ago
6 years ago