Skip to content

Commit 68ed515

Browse files
pnevykgajus
authored andcommitted
fix: bump versions of babel-eslint, eslint and eslint-config-canonical (#359)
1 parent d2c2411 commit 68ed515

27 files changed

+120
-192
lines changed

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@
1111
"devDependencies": {
1212
"ajv": "^6.5.0",
1313
"babel-cli": "^6.26.0",
14-
"babel-eslint": "^6.1.2",
14+
"babel-eslint": "^9.0.0",
1515
"babel-plugin-add-module-exports": "^0.2.1",
1616
"babel-plugin-transform-object-rest-spread": "^6.26.0",
1717
"babel-preset-env": "^1.7.0",
1818
"babel-register": "^6.26.0",
1919
"chai": "^4.1.2",
20-
"eslint": "^3.16.0",
21-
"eslint-config-canonical": "1.8.1",
20+
"eslint": "^5.6.0",
21+
"eslint-config-canonical": "^12.0.0",
2222
"gitdown": "^2.5.2",
2323
"glob": "^7.1.2",
2424
"husky": "^0.14.3",

src/rules/defineFlowType.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,8 @@ const create = (context) => {
5757
makeDefined(qid);
5858
}
5959
},
60-
InterfaceDeclaration (node) {
61-
makeDefined(node.id);
62-
},
60+
61+
// Can be removed once https://github.com/babel/babel-eslint/pull/696 is published
6362
OpaqueType (node) {
6463
if (node.id.type === 'Identifier') {
6564
makeDefined(node.id);

src/rules/genericSpacing.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {spacingFixers} from './../utilities';
1+
import {spacingFixers} from '../utilities';
22

33
const schema = [
44
{
@@ -16,9 +16,9 @@ const create = (context) => {
1616
GenericTypeAnnotation (node) {
1717
const types = node.typeParameters;
1818

19-
// Promise<foo>
20-
// ^^^^^^^^^^^^ GenericTypeAnnotation (with typeParameters)
21-
// ^^^ GenericTypeAnnotation (without typeParameters)
19+
// Promise<foo>
20+
// ^^^^^^^^^^^^ GenericTypeAnnotation (with typeParameters)
21+
// ^^^ GenericTypeAnnotation (without typeParameters)
2222
if (!types) {
2323
return;
2424
}

src/rules/newlineAfterFlowAnnotation.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ const create = (context) => {
3636
context.report({
3737
fix: (fixer) => {
3838
return fixer.insertTextAfter(
39-
potentialFlowFileAnnotation,
40-
newline
41-
);
39+
potentialFlowFileAnnotation,
40+
newline
41+
);
4242
},
4343
message: 'Expected newline after flow annotation',
4444
node

src/rules/noDupeKeys.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import _ from 'lodash/';
22
import {
33
getParameterName
4-
} from './../utilities';
4+
} from '../utilities';
55

66
const schema = [];
77

src/rules/noPrimitiveConstructorTypes.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@ import _ from 'lodash';
33
const schema = [];
44

55
const create = (context) => {
6+
const regex = /^(Boolean|Number|String)$/;
7+
68
return {
79
GenericTypeAnnotation: (node) => {
810
const name = _.get(node, 'id.name');
911

10-
if (RegExp(/^(Boolean|Number|String)$/).test(name)) {
12+
if (regex.test(name)) {
1113
context.report({
1214
data: {
1315
name

src/rules/noWeakTypes.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ const schema = [
44
{
55
additionalProperties: false,
66
properties: {
7-
Function: {
7+
any: {
88
type: 'boolean'
99
},
10-
Object: {
10+
Function: {
1111
type: 'boolean'
1212
},
13-
any: {
13+
Object: {
1414
type: 'boolean'
1515
}
1616
},

src/rules/objectTypeDelimiter.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// ported from babel/flow-object-type; original author: Nat Mote
2-
// https://github.com/babel/eslint-plugin-babel/blob/c0a49d25a97feb12c1d07073a0b37317359a5fe5/rules/flow-object-type.js
1+
// ported from babel/flow-object-type; original author: Nat Mote
2+
// https://github.com/babel/eslint-plugin-babel/blob/c0a49d25a97feb12c1d07073a0b37317359a5fe5/rules/flow-object-type.js
33

44
const SEMICOLON = {
55
char: ';',

src/rules/requireParameterType.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import _ from 'lodash';
22
import {
3-
getParameterName,
4-
iterateFunctionNodes,
5-
quoteName
6-
} from './../utilities';
3+
getParameterName,
4+
iterateFunctionNodes,
5+
quoteName
6+
} from '../utilities';
77

88
const schema = [
99
{

src/rules/requireValidFileAnnotation.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import _ from 'lodash';
22
import {
3-
isFlowFileAnnotation,
4-
fuzzyStringMatch
5-
} from './../utilities';
3+
isFlowFileAnnotation,
4+
fuzzyStringMatch
5+
} from '../utilities';
66

77
const defaults = {
88
annotationStyle: 'none'

0 commit comments

Comments
 (0)