Skip to content

A shareable ESLint configuration for the development of Perfective Angular packages

License

Notifications You must be signed in to change notification settings

perfective/eslint-config-angular

Repository files navigation

Perfective ESLint Config for Angular

@perfective/eslint-config-angular provides a shareable ESLint configuration for Angular development.

@perfective/eslint-config-angular adds the following ESLint plugins to the @perfective/eslint-config configuration:

To simplify configuring ESLint support in the IDEs and editors, the severity of all fixable rules is a warning. It allows distinguishing errors that have to be fixed manually from issues that will be fixed automatically.

Setup

  1. Require @perfective/eslint-config-angular and its peer dependencies as dev dependencies:

    npm install --save-dev @perfective/eslint-config-angular

    Required peer dependencies are installed automatically.

  2. Import perfectiveEslintAngularConfig to eslint.config.js:

    import { perfectiveEslintAngularConfig } from '@perfective/eslint-config-angular';
    
    export default perfectiveEslintAngularConfig();
  3. Optional Install optional peer dependencies to add tool-specific linting rules.

    npm install --save-dev \
        eslint-plugin-cypress \
        eslint-plugin-jest \
        eslint-plugin-jest-dom \
        eslint-plugin-testing-library

    Import configurations to eslint.config.js.

    import { perfectiveEslintAngularConfig } from '@perfective/eslint-config-angular';
    
    // Optional dependencies.
    import { cypressConfig } from '@perfective/eslint-config/cypress';
    import { jestConfig, jestTypescriptConfig } from '@perfective/eslint-config/jest';
    import { jestDomConfig } from '@perfective/eslint-config/jest-dom';
    import { testingLibraryConfig } from '@perfective/eslint-config/testing-library';
    
    export default perfectiveEslintAngularConfig([
        cypressConfig,
        jestConfig,
        jestTypescriptConfig,
        jestDomConfig,
        testingLibraryConfig,
    ]);
    Note
    *.d.ts files and dist directories are ignored by the configuration. node_modules and dot-files are ignored by the eslint. If more directories or file types need to be ignored, see the .eslintignore file docs.

Packages [#packages]

The following is the list of available packages and their exports.

@perfective/eslint-config-angular

  • perfectiveEslintAngularConfig(configs: Linter.Config[] = []): Linter.Config[] — creates a list of flat configs.

@perfective/eslint-config-angular/typescript-eslint

  • typescriptEslintNamingConvention(extensions: TypescriptEslintNamingConvention[] = []): TypescriptEslintNamingConvention[] — creates an Angular-compatible configuration with the given extensions for the @typescript-eslint/naming-convention rule.

About

A shareable ESLint configuration for the development of Perfective Angular packages

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published