PixelOven.Lint

Overview

The Lint API provides a proxy for TsLint as well as StyleLint for handling linting for SCSS, CSS, JavaScript and TypeScript.

Styles

ArgumentDescription
cssAn alias for scss. Implemented to help differentiate CSS from SCSS.
scssA proxy for the StyleLint linter with a few opinionated defaults for easier setup.

Options

For reference on all the available options please review the official documentation for StyleLint.

It is important to note that currently this feature expects a stylelint.json file to be present at the root of the package to configure the compiler.

Setup

First be sure to create a stylelint.json file at the root of the project or in other words adjacent to the package.json.

{
"extends": "stylelint-config-recommended-scss"
}

PixelOven by default provides stylelint-config-recommended-scss as a dependency and highly recommends using this as a starting point for all SCSS based projects.

Usage

Once this has been confirmed all we have to do is run the following.

yarn run pixeloven lint scss

We can also target specific files.

yarn run pixeloven lint scss ./src/index.scss

StyleLint options can be passed through the CLI but it is highly recommended that this behavior be managed with in a stylelint.json file.

TypeScript

It is important to note that currently this feature expects a tslint.json file to be present at the root of the package to configure the compiler.

ArgumentDescription
tsA proxy for the TSLint linter with a few opinionated defaults for easier setup.
tsxAn alias for ts. Implemented to help differentiate JSX based projects.

Options

For reference on all the available options please review the official documentation for TSLint.

Setup

First be sure to create a tslint.json file at the root of the project or in other words adjacent to the package.json.

{
"defaultSeverity": "error",
"extends": [
"tslint:latest",
"tslint-config-prettier",
"tslint-eslint-rules"
]
}

PixelOven by default provides tslint-config-prettier for compatibility between TSLint and Prettier as well as tslint-eslint-rules to match rules against ESLint.

Usage

Once this has been confirmed all we have to do is run the following.

yarn run pixeloven lint ts

We can also target specific files.

yarn run pixeloven lint ts ./src/index.ts

TSLint options can be passed through the CLI but it is highly recommended that this behavior be managed with in a tslint.json file.

Last updated on by Brian Gebel