Skip to content

Commit

Permalink
➕ Add babel, eslint, and istanbul
Browse files Browse the repository at this point in the history
  • Loading branch information
wwilsman committed Apr 22, 2020
1 parent c6306c4 commit 7f72ae6
Show file tree
Hide file tree
Showing 6 changed files with 7,230 additions and 1 deletion.
19 changes: 19 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
parser: babel-eslint
extends: standard
plugins:
- babel
rules:
prefer-const: off
no-unused-expressions: off
babel/no-unused-expressions: warn
promise/param-names: off
semi: [error, always]
generator-star-spacing:
- error
- before: false
after: false
space-before-function-paren:
- error
- anonymous: never
asyncArrow: always
named: never
8 changes: 8 additions & 0 deletions .nycrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"exclude": ["dist", "test"],
"check-coverage": true,
"branches": 100,
"lines": 100,
"functions": 100,
"statements": 100
}
21 changes: 21 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
module.exports = {
presets: [
['@babel/env', {
targets: {
node: '10'
}
}]
],
plugins: [
'@babel/proposal-class-properties'
],
env: {
test: {
plugins: [
['istanbul', {
exclude: ['dist', 'test']
}]
]
}
}
}
19 changes: 18 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
{
"private": true,
"workspaces": [
]
],
"devDependencies": {
"@babel/cli": "^7.8.3",
"@babel/core": "^7.8.3",
"@babel/plugin-proposal-class-properties": "^7.8.3",
"@babel/preset-env": "^7.8.3",
"@babel/register": "^7.8.3",
"babel-eslint": "^10.0.3",
"babel-plugin-istanbul": "^6.0.0",
"eslint": "^6.8.0",
"eslint-config-standard": "^14.1.0",
"eslint-plugin-babel": "^5.3.0",
"eslint-plugin-import": "^2.20.0",
"eslint-plugin-node": "^11.0.0",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-standard": "^4.0.1",
"nyc": "^15.0.0"
}
}
15 changes: 15 additions & 0 deletions scripts/babel-register.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
const path = require('path')

require('@babel/register')({
// allow monorepos to share a single babel config
rootMode: 'upward',

// specified without the cwd so tests can share helpers
only: [
new RegExp(
['packages', '.*?', '(src|test)']
// escape windows path seperators and escape the escape
.join(path.sep === '/' ? '/' : '\\\\')
)
]
})
Loading

0 comments on commit 7f72ae6

Please sign in to comment.