Skip to content

Commit

Permalink
Setup building, linting and testing of TypeScript (jestjs#7808)
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB authored and captain-yossarian committed Jul 18, 2019
1 parent 624d5ba commit 304c0f5
Show file tree
Hide file tree
Showing 41 changed files with 686 additions and 114 deletions.
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,
},
},
};
2 changes: 2 additions & 0 deletions CHANGELOG.md
Expand Up @@ -6,6 +6,8 @@

### Chore & Maintenance

- `[*]`: Setup building, linting and testing of TypeScript ([#7808](https://github.com/facebook/jest/pull/7808))

### Performance

## 24.1.0
Expand Down
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',
],
};

0 comments on commit 304c0f5

Please sign in to comment.