2.0.23 • Published 4 years ago

jest-runner-tslint v2.0.23

Weekly downloads
618
License
MIT
Repository
github
Last release
4 years ago

jest-runner-tslint

Deprecated

Due to the deprecation of TSLint this package is as well in the process of being deprecation. Before this happens officially, this package is following a similar path of maintenance before final deprecation.

In the meantime, if you are currently using this package, please take the time to transition your project to ESLint, typescript-eslint, and jest-runner-eslint.

For more information on the industry-wide transition from TSLint to ESLint, please see the following:

Usage

Install

Install tslint, jest(it needs Jest 21+), and jest-runner-tslint

yarn add --dev tslint jest jest-runner-tslint

# or with NPM

npm install --save-dev tslint jest jest-runner-tslint

Add it to your Jest config

Using Built-in Preset

This package includes a Jest preset which configures Jest to run TSLint on all files supported by TSLint. To use it set the following in your package.json:

{
  "jest": {
    "preset": "jest-runner-tslint"
  }
}

or jest.config.js:

module.exports = {
  preset: "jest-runner-tslint",
};

Manually

In your package.json

{
  "jest": {
    "moduleFileExtensions": ["ts", "tsx", "js", "jsx"],
    "runner": "tslint",
    "testMatch": ["**/*.ts", "**/*.tsx", "**/*.d.ts", "**/*.js", "**/*.jsx"]
  }
}

Or in jest.config.js

module.exports = {
  moduleFileExtensions: ["ts", "tsx", "js", "jsx"],
  runner: "tslint",
  testMatch: ["**/*.ts", "**/*.tsx", "**/*.d.ts", "**/*.js", "**/*.jsx"],
};

Run Jest

yarn jest

Options

This project uses cosmiconfig, so you can provide config via:

  • a jest-runner-tslint property in your package.json
  • a jest-runner-tslint.config.js JS file
  • a .jest-runner-tslintrc JSON file

In package.json

{
  "jest-runner-tslint": {
    "cliOptions": {
      // Options here
    }
  }
}

or in jest-runner-tslint.config.js

module.exports = {
  cliOptions: {
    // Options here
  },
};

cliOptions

jest-runner-tslint maps a lot of ESLint CLI arguments to config options. For example --fix is cliOptions.fix

optiondefaultexample
fixfalse"fix": true
formatter"stylish""formatter": "tap"
formattersDirectorynull"formattersDirectory": "node_modules/custom-tslint-formatters/formatters"
rulesDirectorynull"rulesDirectory": "path/to/rules" or "rulesDirectory": ["path/to/rules", "path/to/other"]
2.0.23

4 years ago

2.0.22

4 years ago

2.0.20

4 years ago

2.0.21

4 years ago

2.0.19

4 years ago

2.0.18

4 years ago

2.0.17

4 years ago

2.0.16

4 years ago

2.0.15

4 years ago

2.0.14

5 years ago

2.0.13

5 years ago

2.0.12

5 years ago

2.0.11

5 years ago

2.0.10

5 years ago

2.0.9

5 years ago

2.0.8

5 years ago

2.0.7

5 years ago

2.0.6

5 years ago

2.0.5

5 years ago

2.0.3

5 years ago

2.0.4

5 years ago

2.0.2

5 years ago

2.0.1

5 years ago

2.0.0

5 years ago

1.1.0

5 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

8 years ago

1.0.0

8 years ago