Atom packages - installed
- atom-typescript
- language-typescript-grammars-only
- linter
- linter-eslint
- linter-stylelint
- linter-ui-default
- prettier-atom
Prettier - settings:
- ESLint Integration = checked
- Stylelint Integration = checked
- EditotConfig Integration = unchecked
.eslintrc
{
"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
}
}
tsconfig.json
{
"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"
]
}
SomeLabel.jsx
- Correctly shows error - A form label must be associated with a control
import React, { FC } from 'react';
const SomeLabel: FC = () => {
return (
<label>hello world</label>
);
};
export default SomeLabel;
SomeLabel.tsx
- Does not show an error!
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
