Skip to content

Docs: How to use in JS-only projects? #10605

@rakleed

Description

@rakleed

Before You File a Documentation Request Please Confirm You Have Done The Following...

Suggested Changes

There are some rules that can be useful in a JavaScript project (no-deprecated, naming-convention, maybe more). Especially no-deprecated, since now a separate plugin for this is no longer supported.

But nowhere in the documentation is it explained how they can be used in a JS project. It seems like this should be enough:

/* eslint.config.js */

import tsEslint from 'typescript-eslint';

export defualt [
  {
    files: ['**/*.js', '**/*.jsx'],
    languageOptions: {
      parser: tsEslint.parser,
      parserOptions: {
        projectService: true,
      },
    },
    plugins: {
      '@typescript-eslint': tsEslint.plugin,
    },
    rules: {
      '@typescript-eslint/no-deprecated': 'error',
    },
  },
];

Affected URL(s)

https://typescript-eslint.io/getting-started/

Additional Info

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    accepting prsGo ahead, send a pull request that resolves this issuedocumentationDocumentation ("docs") that needs adding/updating

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions