Skip to content

Commit 5bdb195

Browse files
authored
Updated deps and configs (#64)
1 parent 2b67dae commit 5bdb195

File tree

11 files changed

+728
-722
lines changed

11 files changed

+728
-722
lines changed

.babelrc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"presets": ["es2015", "stage-0"],
33
"plugins": [
4-
"transform-runtime",
4+
"transform-runtime",
55
"add-module-exports",
66
"transform-flow-strip-types"
7-
]
7+
]
88
}

.editorconfig

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,3 @@ end_of_line = lf
77
charset = utf-8
88
trim_trailing_whitespace = true
99
insert_final_newline = true
10-
11-
[*.yml]
12-
indent_style = space
13-
indent_size = 2
14-
15-
[*.{json,js,jsx,html,css}]
16-
indent_style = space
17-
indent_size = 2
18-
19-
[.eslintrc]
20-
indent_style = space
21-
indent_size = 2
22-
23-
[*.md]
24-
trim_trailing_whitespace = false

.eslintrc

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"extends": "airbnb",
2+
"extends": "airbnb-base",
33
"parser": "babel-eslint",
44
"env": {
55
"node": true,
@@ -10,12 +10,8 @@
1010
"comma-dangle": ["error", "never"],
1111
"consistent-return": 0,
1212
"func-names": 2,
13-
"generator-star-spacing": [0], # HACK: https://github.com/airbnb/javascript/issues/948
14-
"import/newline-after-import": 0,
1513
"import/no-extraneous-dependencies": ["off"],
16-
"jsx-filename-extension": 0,
1714
"new-cap": 0,
18-
"no-implicit-coercion": "error",
1915
"no-mixed-operators": 0,
2016
"no-nested-ternary": 0,
2117
"no-underscore-dangle": 0,

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,4 @@ node_modules
4141

4242
# Compiled source
4343
dist
44+
.eslintcache

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ cache: yarn
1414

1515
script:
1616
- node --version
17-
- npm --version
18-
- npm test
17+
- yarn --version
18+
- yarn test
1919

2020
notifications:
2121
email: false

package.json

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"main": "index.js",
1111
"scripts": {
1212
"build": "cross-env NODE_ENV=production babel src --out-dir dist",
13-
"lint": "eslint --format=node_modules/eslint-formatter-pretty src test *.js",
13+
"lint": "eslint --ignore-path .gitignore --cache --format=node_modules/eslint-formatter-pretty .",
1414
"preversion": "npm run build",
1515
"spec": "npm run build && jest test/format.spec.js",
1616
"test": "npm run lint && npm run spec"
@@ -33,30 +33,28 @@
3333
"dist"
3434
],
3535
"dependencies": {
36-
"babel-plugin-transform-runtime": "^6.15.0",
37-
"shelljs": "^0.7.5",
36+
"babel-plugin-transform-runtime": "^6.22.0",
37+
"shelljs": "^0.7.6",
3838
"slash": "^1.0.0"
3939
},
4040
"devDependencies": {
41-
"babel-cli": "^6.18.0",
41+
"babel-cli": "^6.22.2",
4242
"babel-eslint": "^7.1.1",
4343
"babel-plugin-add-module-exports": "^0.2.1",
44-
"babel-plugin-transform-flow-strip-types": "^6.21.0",
45-
"babel-preset-es2015": "^6.18.0",
46-
"babel-preset-stage-0": "^6.16.0",
47-
"babel-register": "^6.18.0",
44+
"babel-plugin-transform-flow-strip-types": "^6.22.0",
45+
"babel-preset-es2015": "^6.22.0",
46+
"babel-preset-stage-0": "^6.22.0",
47+
"babel-register": "^6.22.0",
4848
"chai": "^3.5.0",
49-
"cross-env": "^3.1.3",
50-
"eslint": "^3.12.2",
51-
"eslint-config-airbnb": "^13.0.0",
49+
"cross-env": "^3.1.4",
50+
"eslint": "^3.14.1",
51+
"eslint-config-airbnb-base": "^11.0.1",
5252
"eslint-formatter-pretty": "^1.1.0",
5353
"eslint-nibble-ignore": "^3.0.0",
5454
"eslint-plugin-import": "^2.2.0",
55-
"eslint-plugin-jsx-a11y": "^2.0.2",
56-
"eslint-plugin-react": "^6.8.0",
57-
"flow-bin": "^0.37.4",
58-
"jest-cli": "^18.0.0",
59-
"react": "^15.4.1"
55+
"flow-bin": "^0.38.0",
56+
"jest-cli": "^18.1.0",
57+
"react": "^15.4.2"
6058
},
6159
"engines": {
6260
"node": ">=6.x",

test/.eslintrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
{
22
"env": {
33
"jest": true
4+
},
5+
"rules": {
6+
"global-require": 0,
7+
"import/no-dynamic-require": 0,
8+
"no-restricted-syntax": 0
49
}
510
}

test/4.example.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
1-
/*
2-
eslint
3-
react/prefer-stateless-function: 0,
4-
react/no-multi-comp: 0,
5-
react/jsx-filename-extension: 0
6-
*/
7-
1+
/* eslint-disable */
82
/**
93
* @flow
104
*/

test/4.expect.js

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,38 @@
11
export default [
22
{
3-
end: 18,
3+
end: 12,
44
loc: {
55
end: {
66
column: 3,
7-
line: 18,
8-
offset: 264
7+
line: 12,
8+
offset: 171
99
},
1010
start: {
1111
column: 10,
12-
line: 15,
13-
offset: 214
12+
line: 9,
13+
offset: 121
1414
}
1515
},
16-
message: "property `lastName`: Property not found in 'props of React element `Foo`'. See line 31",
17-
start: 15,
16+
message: "property `lastName`: Property not found in 'props of React element `Foo`'. See line 25",
17+
start: 9,
1818
type: 'default'
1919
},
2020
{
21-
end: 31,
21+
end: 25,
2222
loc: {
2323
end: {
24-
column: 32,
25-
line: 31,
26-
offset: 489
24+
column: 35,
25+
line: 25,
26+
offset: 399
2727
},
2828
start: {
29-
column: 27,
30-
line: 31,
31-
offset: 483
29+
column: 12,
30+
line: 25,
31+
offset: 375
3232
}
3333
},
34-
message: "string: This type is incompatible with 'object type'. See line 16",
35-
start: 31,
34+
message: "props of React element `Foo`: This type is incompatible with 'object type'. See line 9",
35+
start: 25,
3636
type: 'default'
3737
}
3838
];

test/format.spec.js

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
1-
/*
2-
eslint global-require: 0,
3-
import/no-dynamic-require: 0,
4-
no-restricted-syntax: 0
5-
*/
6-
import { expect } from 'chai';
71
import path from 'path';
2+
import { expect as chaiExpect } from 'chai';
83
import { readFileSync } from 'fs';
94
import collect from '../src/collect';
105

@@ -22,7 +17,7 @@ const testFilenames = [
2217

2318
const testResults = testFilenames.map((filename, index) => {
2419
const root = process.cwd();
25-
const filepath = path.join(root, `./test/${filename}`);
20+
const filepath = path.join(root, 'test', filename);
2621
const stdin = readFileSync(filepath).toString();
2722
const parsedJSONArray = collect(stdin, root, filepath);
2823

@@ -34,7 +29,7 @@ describe('Format', () => {
3429
it(`${filename} - should have expected properties`, done => {
3530
const exactFormat = require(`./${filename}`.replace('example', 'expect'));
3631

37-
expect(parsedJSONArray).to.be.an('array');
32+
chaiExpect(parsedJSONArray).to.be.an('array');
3833

3934
// Filter out the 'path' property because this changes between environments
4035
expect(parsedJSONArray.map(e => ({
@@ -43,13 +38,14 @@ describe('Format', () => {
4338
loc: { start: e.loc.start, end: e.loc.end },
4439
message: e.message,
4540
start: e.start
46-
}))).to.eql(exactFormat);
41+
})))
42+
.toEqual(exactFormat);
4743

4844
for (const e of parsedJSONArray) {
4945
if (e !== false) {
50-
expect(e.type).to.be.a('string');
51-
expect(e.path).to.be.a('string').that.includes(path.join(process.cwd(), 'test'));
52-
expect(e.path).to.be.a('string').that.includes('.example.js');
46+
chaiExpect(e.type).to.be.a('string');
47+
chaiExpect(e.path).to.be.a('string').that.contains(path.join(process.cwd(), 'test'));
48+
chaiExpect(e.path).to.be.a('string').that.contains('.example.js');
5349
}
5450
}
5551

0 commit comments

Comments
 (0)