8000 Docs: Misleading statement: "Contains all of `stylistic`, along with additional stylistic rules that require type information." · Issue #11211 · typescript-eslint/typescript-eslint · GitHub
[go: up one dir, main page]

Skip to content
Docs: Misleading statement: "Contains all of stylistic, along with additional stylistic rules that require type information." #11211
Closed as not planned
@bjenkins-partstech

Description

@bjenkins-partstech

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

Suggested Changes

* Contains all of `stylistic`, along with additional stylistic rules that require type information.

This statement led me to think that I wouldn't need any @stylistic/* packages and that by using the tseslint.configs.stylisticTypeChecked config I would get stylistic lint errors out of the box.

Affected URL(s)

https://typescript-eslint.io/users/configs/#stylistic-type-checked

Additional Info

It may also be worthwhile to provide an example for those looking to use both typescript-eslint and stylistic.

It was rather challenging for me to come up with this:

import eslint from "@eslint/js";
import tseslint from "typescript-eslint";
import stylistic from '@stylistic/eslint-plugin-ts'
//import stylisticJsx from '@stylistic/eslint-plugin-jsx'

export default tseslint.config(
    eslint.configs.recommended,
    tseslint.configs.recommendedTypeChecked,
    tseslint.configs.stylisticTypeChecked,
    stylistic.configs.all,
    {
        "languageOptions": {
            "parser": tseslint.parser,
            "parserOptions": {
                //"project": "./tsconfig.json",
                "projectService": true,
                "tsconfigRootDir": import.meta.dirname
            }
        },
        "plugins": {
            "@stylistic/ts": stylistic,
            //"@stylistic/jsx": stylisticJsx
        }
    }
);

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationDocumentation ("docs") that needs adding/updatingfix: user errorissue was fixed by correcting the configuration / correcting the codelocked due to agePlease open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0