Skip to content

Commit

Permalink
fix: fixes js style to be node < 10 compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
huafu committed Aug 20, 2018
1 parent a04f69a commit 83d7517
Show file tree
Hide file tree
Showing 24 changed files with 835 additions and 323 deletions.
28 changes: 28 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
module.exports = {
env: {
node: true,
es6: true,
},
extends: 'eslint:recommended',
parserOptions: {
ecmaVersion: 6,
sourceType: 'module',
impliedStrict: true,
},
rules: {
indent: ['error', 2],
'linebreak-style': ['error', 'unix'],
quotes: ['error', 'single'],
semi: ['error', 'never'],
'comma-dangle': [
'error',
{
arrays: 'always-multiline',
objects: 'always-multiline',
imports: 'always-multiline',
exports: 'always-multiline',
functions: 'never',
},
],
},
}
4 changes: 4 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@ singleQuote: true
tabWidth: 2
useTabs: false
trailingComma: all
overrides:
- files: "**/*.js"
options:
trailingComma: es5
2 changes: 1 addition & 1 deletion e2e/__helpers__/test-case.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// tslint:disable-file:no-shadowed-variable
import { sync as spawnSync } from 'cross-spawn'
import { join, relative, sep } from 'path'
import * as Paths from '../../scripts/paths'
import * as Paths from '../../scripts/lib/paths'
import * as fs from 'fs-extra'
import { RawSourceMap } from 'source-map'
import { relativiseSourceRoot, extractSourceMaps } from './source-maps'
Expand Down
2 changes: 1 addition & 1 deletion e2e/__templates__/default/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
globals: { 'ts-jest': { tsConfig: {} } },
};
}
2 changes: 1 addition & 1 deletion e2e/__templates__/with-babel-6/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
globals: { 'ts-jest': { tsConfig: {}, babelConfig: true } },
};
}
2 changes: 1 addition & 1 deletion e2e/__templates__/with-babel-7/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
globals: { 'ts-jest': { tsConfig: {}, babelConfig: true } },
};
}
4 changes: 2 additions & 2 deletions e2e/__templates__/with-jest-22/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const { jestPreset } = require('ts-jest');
const { jestPreset } = require('ts-jest')

module.exports = Object.assign({}, jestPreset, {
testEnvironment: 'node',
globals: { 'ts-jest': { tsConfig: {} } },
});
})
2 changes: 1 addition & 1 deletion e2e/__templates__/with-typescript-2-7/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
globals: { 'ts-jest': { tsConfig: {}, diagnostics: { ignoreCodes: [5023] } } }
};
}
2 changes: 1 addition & 1 deletion e2e/__templates__/with-unsupported-version/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
globals: { 'ts-jest': { tsConfig: {}, diagnostics: { ignoreCodes: [5023, 5024] } } }
};
}
Loading

0 comments on commit 83d7517

Please sign in to comment.