README
@alwaysai/eslint-config
ESLint configurations for alwaysAI projects
Usage
Install this package and the eslint command-line tool:
npm install --save --save-dev @alwaysai/eslint-config eslint
Create a file .eslintrc.json at the root of your project with contents:
{
"extends": [
"@alwaysai/eslint-config"
]
}
Add these lines to your package.json's "scripts" field:
"lint": "eslint --ext .ts,.tsx <directory>",
"lint:fix": "npm run lint -- --fix",
where <directory> is the subdirectory of your project containing the source code that you want to lint. Finally add && npm run lint to your package's "test" script to make sure you enforce the lint rules! We recommend setting up your editor to automatically fix lint errors on save. That way the linter mostly stays out of your way and just does the right thing. In Visual Studio Code, this plugin works great.
Rules
This package's rules extend those espoused by by AirBnB, consumed as eslint-config-airbnb. Those rules are mostly concerned with syntax. For code formatting, this package uses eslint-config-prettier, which disables all rules that are unnecessary or might conflict with Prettier. Instead of calling prettier directly, this package employs eslint-plugin-prettier, which "runs Prettier as a ESLint rule and reports differences as individual ESLint issues".
Related
- @alwaysai/tsconfig: TypeScript configurations for alwaysAI projects
License
MIT © alwaysAI, Inc.