Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use babel for typescript compilation with minimal changes #1738

Merged
merged 4 commits into from Jun 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions .babelrc.js
Expand Up @@ -3,7 +3,7 @@ const cjs = NODE_ENV === 'test' || BABEL_ENV === 'commonjs'
const loose = true

module.exports = {
presets: [['@babel/env', { loose, modules: false }]],
presets: [['@babel/env', { loose, modules: false }], '@babel/preset-typescript'],
plugins: [
['@babel/proposal-decorators', { legacy: true }],
['@babel/proposal-object-rest-spread', { loose }],
Expand All @@ -18,5 +18,5 @@ module.exports = {
].replace(/^[^0-9]*/, '')
}
]
].filter(Boolean)
].filter(Boolean),
}
9 changes: 8 additions & 1 deletion .eslintrc
@@ -1,14 +1,20 @@
{
"parser": "babel-eslint",
"parser": "@typescript-eslint/parser",
"extends": [
"eslint:recommended",
"plugin:import/recommended",
"plugin:react/recommended",
"plugin:prettier/recommended"
// "plugin:@typescript-eslint/recommended"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Their documentation recommends turning this on, and we normally do in projects I work with, but it generates a lot of noise in the js files and I don't think there's a way to do an "extends" for only one type of file. I say we leave it off for now and consider turning it on when we're most of the way through the conversion, unless people on this project don't mind seeing and ignoring lint errors while they work.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yeah, my experience has been that ruleset is way to over-opinionated.

We don't want to be focusing on lint rules right now. The immediate goal is just to get stuff compiling at all, and then get most of the existing types into place. Linting would be a last step.

],
"settings": {
"react": {
"version": "detect"
},
"import/resolver": {
"node": {
"extensions": [".js", ".ts"]
}
}
},
"parserOptions": {
Expand All @@ -32,6 +38,7 @@
"react/no-string-refs": 0
},
"plugins": [
"@typescript-eslint",
"import",
"react"
]
Expand Down