Skip to content

Latest commit

 

History

History
99 lines (65 loc) · 3.24 KB

Quickstart.mdx

File metadata and controls

99 lines (65 loc) · 3.24 KB
id title slug pagination_next
quickstart
Getting Started
/getting-started/
getting-started/typed-linting

import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem';

:::note This page is a quick-start guide for ESLint's new "flat" config format to help you go from zero to linting as quick as possible.

:::

Quickstart

These steps will get you running ESLint with our recommended rules on your TypeScript code as quickly as possible.

Step 1: Installation

First, install the required packages for ESLint, TypeScript, and our tooling:

npm install --save-dev eslint typescript typescript-eslint

Step 2: Configuration

Next, create an eslint.config.js config file in the root of your project, and populate it with the following:

// @ts-check

import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';

export default tseslint.config(
  eslint.configs.recommended,
  ...tseslint.configs.recommended,
);

This code will enable our recommended configuration for linting.

Step 3: Running ESLint

Open a terminal to the root of your project and run the following command:

npx eslint .
yarn eslint .
pnpm eslint .

ESLint will lint all TypeScript compatible files within the current folder, and will output the results to your terminal.

Details

See ESLint's Configuration Files docs for more details on configuring ESLint.

Next Steps

We provide a plethora of powerful rules that utilize the power of TypeScript's type information.

Visit the next page for a setup guide.

If you're having problems getting this working, please have a look at our Troubleshooting & FAQs.

Documentation Resources