🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

@krema/angular-eslint-stylelint-builder

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@krema/angular-eslint-stylelint-builder

Angular CLI builder for ESLint and stylelint

1.4.0
latest
Source
npm
Version published
Weekly downloads
1.3K
-14.93%
Maintainers
1
Weekly downloads
 
Created
Source

Angular ESLint + Stylelint Linter

npm version node workflow node workflow

An Angular CLI builder inspired by @angular-eslint/builder for linting Angular applications using ESLint and stylelint.

The library works with following Angular versions:

9 10 11 12 13 14

Prerequisites

Installed and configured eslint and stylelint e.g. via .eslintrc and .stylelintrc.

For more information on converting TSLint to ESLint in Angular projects please see the following @angular-eslint project.

Install

npm install --save-dev @krema/angular-eslint-stylelint-builder

Usage

Add the builder @krema/angular-eslint-stylelint-builder:lint" to the lint task in your angular.json.

angular.json

projects → <my-project> → architect → lint

Replace the builder of @angular-eslint with @krema/angular-eslint-stylelint-builder:

 "lint": {
-    "builder": "@angular-eslint/builder:lint",
+    "builder": "@krema/angular-eslint-stylelint-builder:lint",
     "options": {
-        "lintFilePatterns": ["**/*.ts"]
+        "eslintFilePatterns": ["**/*.ts"],
+        "stylelintFilePatterns": ["**/*.scss"]
     }
 }

Run ng lint:

Configuration

The following options can be configured:

NameDefault ValueDescriptionRequiredLinter
Basic configuration:
eslintFilePatterns[] One or more files/dirs/globs to pass directly to ESLint's lintFiles() method. i.e. ["src/**/*.ts"] trueeslint
eslintConfig Use this configuration, overriding .eslintrc.* config options if present eslint
stylelintFilePatterns[] One or more files/dirs/globs to pass directly to stylelint's lint() method. ["src/**/*.scss"] truestylelint
stylelintConfig Path to the stylelint configuration filestylelint
noEslintrcfalse Disables use of configuration from .eslintrc.* and package.json files. eslint
fixfalse Automatically fix, where possible, violations reported by rules (may overwrite linted files) eslint, stylelint
Cache-related:
eslintCachefalse Store the results of processed files so that ESLint only operates on the changed ones eslint
stylelintCachefalse Store the results of processed files so that stylelint only operates on the changed ones stylelint
eslintCacheLocation.eslintcachePath to the cache file or directoryeslint
stylelintCacheLocation.stylelintcachePath to the cache file or directorystylelint
eslintCacheStrategymetadata Strategy to use for detecting changed files in the cache. Can be either metadata or content eslint
File Enumeration:
eslintIgnorePath A path to a file containing patterns describing files to ignore instead of $CWD/.eslintignore eslint
stylelintIgnorePath A path to a file containing patterns describing files to ignore instead of $CWD/.stylelintignore stylelint
eslintRulesDir[] This option allows you to specify another directory from which to load rules files eslint
eslintResolvePluginsRelativeToChanges the folder where plugins are resolved fromeslint
Output:
outputFileFile to write report to instead of the consoleeslint, stylelint
formatstylish The output is formatted by using the ESLint Output formatter eslint, stylelint
silentfalseHide output texteslint, stylelint
Handling warnings:
quietfalse Only register violations for rules with an "error"-level severity (ignore "warning"-level) eslint, stylelint
maxWarnings-1Number of warnings to trigger nonzero exit codeeslint, stylelint
forcefalseSucceeds even if there was linting errorseslint, stylelint

Keywords

angular

FAQs

Package last updated on 05 Mar 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts