Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@solid/eslint-config-base

Package Overview
Dependencies
Maintainers
14
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@solid/eslint-config-base

Solid defaults for eslinting.

Source
npmnpm
Version
0.1.5
Version published
Weekly downloads
18
-63.27%
Maintainers
14
Weekly downloads
 
Created
Source

ESLint Base Configuration

Solid defaults for eslinting.

Install

  • Install package and its peer-dependencies
    npm install --save-dev @solid/eslint-config-base
    npx install-peerdeps -D @solid/eslint-config-base
    
  • Create .eslintrc.js extending base configuration
    printf 'module.exports = {\n  extends: [ "@solid/eslint-config-base" ]\n};\n' > .eslintrc.js
    

Linting TypeScript

Requirements

Requires both './tsconfig.json' and './test/tsconfig.json'.

Create a simple tests TypeScript configuration extending from the base one:

{
   "extends": "../tsconfig.json",
   "include": [
      "."
   ]
}

A common error

Why is './test/tsconfig.json' required?

  • We use './tsconfig.json' which should not include the test directory for parser options.
  • The @typescript-eslint/parser needs to know how to parse all TypeScript files.
  • Without a TypeScript configuration for tests linting will error:
    Parsing error: "parserOptions.project" has been set for @typescript-eslint/parser.
    The file does not match your project config: <TEST_FILE>
    The file must be included in at least one of the projects provided.
    

Therefore @typescript-eslint/parser's project parser options has './tsconfig.json' and './test/tsconfig.json'.

Linting will error if './test/tsconfig.json' is missing from a TypeScript project using @solid/eslint-config-base.

Keywords

eslint

FAQs

Package last updated on 21 Dec 2020

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