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

Setup building, linting and testing of TypeScript #7808

Merged
merged 6 commits into from Feb 6, 2019
Merged
Show file tree
Hide file tree
Changes from 5 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
14 changes: 14 additions & 0 deletions .eslintrc.js
Expand Up @@ -15,6 +15,19 @@ module.exports = {
'prettier/flowtype',
],
overrides: [
{
files: ['*.ts', '*.tsx'],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint/eslint-plugin'],
rules: {
'@typescript-eslint/no-unused-vars': [
'error',
{argsIgnorePattern: '^_'},
],
'import/order': 'error',
'no-unused-vars': 'off',
},
},
// to make it more suitable for running on code examples in docs/ folder
{
files: ['*.md'],
Expand Down Expand Up @@ -122,6 +135,7 @@ module.exports = {
'^types/(.*)': './types/$1',
},
},
'eslint-import-resolver-typescript': true,
},
},
};
16 changes: 15 additions & 1 deletion babel.config.js
Expand Up @@ -2,6 +2,21 @@

module.exports = {
babelrcRoots: ['examples/*'],
overrides: [
{
presets: ['@babel/preset-flow'],
test: '**/*.js',
},
{
plugins: [
require.resolve(
'./scripts/babel-plugin-jest-replace-ts-export-assignment.js'
),
],
presets: ['@babel/preset-typescript'],
test: /\.tsx?$/,
},
],
plugins: [
['@babel/plugin-transform-modules-commonjs', {allowTopLevelThis: true}],
'@babel/plugin-transform-strict-mode',
Expand All @@ -14,6 +29,5 @@ module.exports = {
targets: {node: 6},
},
],
'@babel/preset-flow',
],
};