Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@exercism/eslint-config-tooling

Package Overview
Dependencies
Maintainers
0
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@exercism/eslint-config-tooling

ESLint configuration for various pieces of tooling on Exercism

  • 0.6.0
  • latest
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

@exercism/eslint-config-tooling

This is the shared eslint configuration used by various pieces of tooling, such as the JavaScript Analyzer, Representer, and Test Runner. The same configuration is used for the TypeScript tooling as well as various other pieces of technology. Shareable configs are designed to work with the extends feature of ESLint configuration files. This means you can use the same configuration Exercism uses in your own projects!

Usage

To use the configuration, open your eslint configuration file, and add the following value to your flat config. For example, for flat config configuration files:

import baseConfig from '@exercism/eslint-config-tooling';

// ...
export default [
  ...baseConfig,
  // ... your configuration
];

Configuration

Find the configuration here. It's goal is to help detect and prevent common problems, and enforce a consistent code style.

The rules are based on:

  • eslint:recommended
  • A few extra rules that catch common issues but are not enabled via the recommended plugin.

It also includes the prettier plugin because we use prettier to achieve consistent code formatting. This plugin turns off rules that conflict with formatting.

Because most of the tooling is primarily focussing on running on Node, only node globals are turned on in the environment, but when extending this configuration, you can add more (or turn those off).

Type-based rules

In order to be able to use type information in the eslint rules, the parser is automatically set up for TypeScript files .ts and .tsx.

Setup with multiple tsconfig.json and ts-paths

When working with multiple folders and a composite tsconfig.json structure and/or using the compilerOptions with paths, you might have difficulty resolving issues around it not being able to find files, definitions, and more. A common problem is eslint complaining about files not being present or included in the configuration. Another common problem is types reporting as any to eslint, even when they do resolve inside the editor.

An easy way to resolve this is to create a new tsconfig.eslint.json that includes all the files in the project, including the test files. That tsconfig.eslint.json should then be referred in project, instead of the regular configuration file. You can check out the JavaScript Analyzer for an example.

FAQs

Package last updated on 08 Aug 2024

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc