Description
Before You File a Documentation Request Please Confirm You Have Done The Following...
- I have looked for existing open or closed documentation requests that match my proposal.
- I have read the FAQ and my problem is not listed.
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:
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.