🚀 DAY 4 OF LAUNCH WEEK:Introducing Socket Scanning for OpenVSX Extensions.Learn more →
Socket
Book a DemoInstallSign in
Socket

eslint-config-tester

Package Overview
Dependencies
Maintainers
9
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-config-tester

ESLint configuration tester

latest
Source
npmnpm
Version
3.0.8
Version published
Maintainers
9
Created
Source

ESLint Config Tester

eslint-config-tester is a utility library to write tests for ESLint configurations. It relies on eslint.CLIEngine to run configurations.

Installation

Install ESLint locally.

$ yarn add eslint --dev

Install the ESlint Config Tester locally.

$ yarn add eslint-config-tester --dev

Usage

eslint-config-tester exposes a single runOnText method. This method lets you run any given configuration against a JavaScript snippet. It throws an error if the configuration has any problems or the JavaScript snippet violates the rules set by the configuration.

'use strict';

const eslintConfigTester = require('eslint-config-tester');
const path = require('path');

const pathToEslintConfig = path.resolve(__dirname, 'index.js');
const jsSnippetToTest = "const hello = 'world';\nexport default hello;\n";

eslintConfigTester.prettierCheck(
    pathToYourEslintConfig,
);

eslintConfigTester.runOnText(
    pathToYourEslintConfig,
    jsSnippetToTest
);

Contributing

See Contributing.

FAQs

Package last updated on 12 Dec 2019

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