{
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2020,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true,
"modules": true,
"impliedStrict": true,
"experimentalObjectRestSpread": true
}
},
"settings": {
"react": {
"pragma": "React",
"version": "detect"
},
"import/resolver": {
"node": {
"extensions": [".js", ".jsx", ".ts", ".tsx"],
"paths": ["./"]
},
"babel-module": {}
}
},
"extends": [
"plugin:react/recommended",
"airbnb",
"plugin:prettier/recommended",
"plugin:@typescript-eslint/recommended",
"prettier/react",
"prettier/@typescript-eslint",
"plugin:import/typescript"
],
"plugins": ["react", "@typescript-eslint", "prettier", "mocha"],
"env": {
"es6": true,
"browser": true,
"jest": true,
"mocha": true,
"node": true
}
}
{
"compileOnSave": false,
"compilerOptions": {
"allowJs": true,
"allowSyntheticDefaultImports": true,
"baseUrl": "./",
"forceConsistentCasingInFileNames": true,
"isolatedModules": true,
"jsx": "react",
"module": "esnext",
"moduleResolution": "node",
"noEmit": true,
"noImplicitAny": true,
"outDir": "./dist/out-tsc",
"resolveJsonModule": true,
"sourceMap": true,
"strict": true,
"target": "esnext",
"downlevelIteration": true,
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"skipLibCheck": true,
"esModuleInterop": true
},
"include": [
"src",
"src/__tests__"
],
"exclude": [
"node_modules",
"public"
]
}
import React, { FC } from 'react';
const SomeLabel: FC = () => {
return (
<label>hello world</label>
);
};
export default SomeLabel;
import React, { FC } from 'react';
const SomeLabel: FC = () => {
return (
<label>hello world</label>
);
};
export default SomeLabel;
The jsx files correctly take on the eslint errors, where as the typescript file extensions do not. This works automatically with visual studio code, but not atom. How can I get atom to work the same?
thankyou
I had the same problem and the issue on linter-eslint
GitHub's repo helped me.
You need to tell linter-eslint that it actually knows how to handle TypeScript files.
You can do that by adding the scope for TypeScript files (source.ts) here:
The screenshot above is from settings page of the package linter-eslint
(Preferences > Packages > linter-eslint).
I've added source.ts
and source.tsx
, reloaded the window (View > Developer > Reload window) and Atom started to display my lint errors.