8000 Docs: Potentially confusing flow for enabling typed linting · Issue #6982 · typescript-eslint/typescript-eslint · GitHub
[go: up one dir, main page]

Skip to content
Docs: Potentially confusing flow for enabling typed linting #6982
Closed as not planned
@zacharysyoung

Description

@zacharysyoung

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

Suggested Changes

Related to #6826 and its PR #6919, I'm still getting the error, and still don't know what approach to take.

I tried the suggested "popular setup..." and ended up with the following:

.eslintrc.cjs

/* eslint-env node */
module.exports = {
    extends: [
        'eslint:recommended',
        'plugin:@typescript-eslint/recommended',
    ],
    parser: '@typescript-eslint/parser',
    parserOptions: {
        project: true,
        tsconfigRootDir: '.',
    },
    plugins: ['@typescript-eslint'],
    root: true,
    rules: {
        "semi": ["error", "always"]
    },
    overrides: [
        {
            extends: [
                'plugin:@typescript-eslint/recommended-requiring-type-checking',
            ],
            files: ['./**/*.{ts,tsx}'],
        },
    ],
};

tsconfig.json

{
    "compilerOptions": {
        "target": "es5",
        "module": "commonjs",
        "outDir": "out",
        "strictNullChecks": true
    },
}

package.json

{
  "type": "commonjs",
  "devDependencies": {
    "@typescript-eslint/eslint-plugin": "^5.59.2",
    "@typescript-eslint/parser": "^5.59.2",
    "eslint": "^8.39.0",
    "typescript": "^5.0.4"
  }
}

Did I misunderstand something in the // ... the rest of your config ... part of the CJS file?

You can see in the screenshot my .eslintr.cjs, and a foo.js in the out dir, are affected:

Screenshot 2023-05-02 at 21 18 55

Maybe I'm not the right audience for this "Getting Started": I've had some success getting ESLint configured for some JavaScript development I've done (and will continue to do), and I just decide to take the plunge and try and port a small codebase to TypeScript and I wanted the comfort and security I've gotten with ESLint over in JS-Land, which lead me to this Getting Started.

Sincerely, and thank you.

Affected URL(s)

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationDocumentation ("docs") that needs adding/updatingwontfixThis will not be worked on

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0