@yoo-digital/eslint-config-angular
v21.0.0
Published
ESLint configuration file containing rules for Angular projects using TypeScript
Readme
YOO ESLint Configuration for Angular Projects
Contains the settings and rules used for Angular projects based on TypeScript within YOO. It is publicly available via the npm registry.
Purpose
The exported index.js file contains all the ESLint rules that are compatible with our coding guidelines. See the guidelines for more information.
This set of rules can be applied to Angular applications written in TypeScript.
The base set of rules are framework agnostic can be found here.
For React projects you can consult this package.
Usage
In order to use the ESLint configuration file in your project, you will have to install its dependencies (including peer-dependencies). The following commands work for both npm and yarn. It will detect the proper client.
npx install-peerdeps --dev @yoo-digital/eslint-config-base
npx install-peerdeps --dev @yoo-digital/eslint-config-angularAfter installing the packages, you can create a eslint.config.mjs file in the root of your project and add the following lines:
// @ts-check
import yooAngularEslintConfig from '@yoo-digital/eslint-config-angular';
// Optional
// import yooBaseEslintConfig from '@yoo-digital/eslint-config-base';
export default [
// Optional
// ...yooBaseEslintConfig,
...yooAngularEslintConfig,
{
languageOptions: {
parserOptions: {
project: ['./tsconfig.json', './tsconfig.app.json', './tsconfig.spec.json'],
tsconfigRootDir: import.meta.dirname,
},
},
},
// your own rules
];You can apply your own set of rules on top of that, but do not turn off any of the rules, except it is an obstacle and making your life harder. Check the chapter below, for a complete set of rules that can be applied.
Development
Important: This configuration should only contain the Angular specific ESLint configuration.
Before creating a pull request or publishing changes, make sure you tested your changes.
Within this mono-repository you will find an example Angular application in the examples/angular-app directory.
Run npm run lint in that directory to test your changes.
