diff --git a/package.json b/package.json index db353ef6..18c5614c 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ }, "description": "Flowtype linting rules for ESLint.", "devDependencies": { - "ajv": "^6.10.2", + "ajv": "^6.12.2", "babel-cli": "^6.26.0", "babel-eslint": "^10.1.0", "babel-plugin-add-module-exports": "^1.0.2", @@ -20,13 +20,13 @@ "eclint": "^2.8.1", "eslint": "^7.0.0", "eslint-config-canonical": "^19.0.4", - "gitdown": "^3.1.1", - "glob": "^7.1.4", - "husky": "^3.0.3", + "gitdown": "^3.1.3", + "glob": "^7.1.6", + "husky": "^4.2.5", "jsonlint": "^1.6.3", - "mocha": "^6.2.0", - "rimraf": "^3.0.0", - "semantic-release": "^15.13.19" + "mocha": "^7.1.2", + "rimraf": "^3.0.2", + "semantic-release": "^17.0.7" }, "engines": { "node": "^10.12.0 || >=12.0.0" diff --git a/src/bin/checkDocs.js b/src/bin/checkDocs.js index 933edb91..125b2b2f 100644 --- a/src/bin/checkDocs.js +++ b/src/bin/checkDocs.js @@ -90,7 +90,7 @@ const checkDocs = (rulesNames) => { throw new Error( 'Docs checker encountered an error in: ' + invalidList + '. ' + 'Make sure that for every rule you created documentation file with assertions placeholder in camelCase ' + - 'and included the file path in `.README/README.md` file.' + 'and included the file path in `.README/README.md` file.', ); } }; diff --git a/src/bin/checkTests.js b/src/bin/checkTests.js index 8acef78c..580d8ece 100644 --- a/src/bin/checkTests.js +++ b/src/bin/checkTests.js @@ -58,7 +58,7 @@ const checkTests = (rulesNames) => { throw new Error( 'Tests checker encountered an error in: ' + invalidList + '. ' + - 'Make sure that for every rule you created test suite and included the rule name in `tests/rules/index.js` file.' + 'Make sure that for every rule you created test suite and included the rule name in `tests/rules/index.js` file.', ); } }; diff --git a/src/rules/defineFlowType.js b/src/rules/defineFlowType.js index 1e065bfd..b172ec69 100644 --- a/src/rules/defineFlowType.js +++ b/src/rules/defineFlowType.js @@ -18,7 +18,7 @@ const create = (context) => { globalScope.__defineGeneric( ident.name, globalScope.set, - globalScope.variables + globalScope.variables, ); const variable = globalScope.set.get(ident.name); diff --git a/src/rules/newlineAfterFlowAnnotation.js b/src/rules/newlineAfterFlowAnnotation.js index c188e205..3145db49 100644 --- a/src/rules/newlineAfterFlowAnnotation.js +++ b/src/rules/newlineAfterFlowAnnotation.js @@ -25,7 +25,7 @@ const create = (context) => { context.getAllComments(), (comment) => { return looksLikeFlowFileAnnotation(comment.value); - } + }, ); if (potentialFlowFileAnnotation) { @@ -37,7 +37,7 @@ const create = (context) => { fix: (fixer) => { return fixer.insertTextAfter( potentialFlowFileAnnotation, - newline + newline, ); }, message: 'Expected newline after flow annotation', @@ -57,7 +57,7 @@ const create = (context) => { lineBreak === '\r' ? 2 : 1 ), ], - '' + '', ); }, message: 'Expected no newline after flow annotation', diff --git a/src/rules/noDupeKeys.js b/src/rules/noDupeKeys.js index 6fe87dc1..8a5f569c 100644 --- a/src/rules/noDupeKeys.js +++ b/src/rules/noDupeKeys.js @@ -52,7 +52,7 @@ const create = (context) => { const element = analizeElement( property.type === 'ObjectTypeSpreadProperty' ? property.argument : - property.value + property.value, ); return { diff --git a/src/rules/requireValidFileAnnotation.js b/src/rules/requireValidFileAnnotation.js index 4c5430c4..b56eeb59 100644 --- a/src/rules/requireValidFileAnnotation.js +++ b/src/rules/requireValidFileAnnotation.js @@ -100,7 +100,7 @@ const create = (context) => { fix: (fixer) => { return fixer.replaceTextRange( [potentialFlowFileAnnotation.range[0], potentialFlowFileAnnotation.range[1]], - annotation + annotation, ); }, message: 'Flow file annotation style must be `' + annotation + '`', diff --git a/src/rules/sortKeys.js b/src/rules/sortKeys.js index c967ebce..ad15a2e8 100644 --- a/src/rules/sortKeys.js +++ b/src/rules/sortKeys.js @@ -186,7 +186,7 @@ const generateFix = (node, context, sort) => { property.range[0]; const subString = source.getText().slice( startIndex, - beforePunctuator.range[1] + beforePunctuator.range[1], ); nodeText = nodeText.replace(subString, '$' + index); diff --git a/src/utilities/isFlowFile.js b/src/utilities/isFlowFile.js index e0ee9ee4..2816630c 100644 --- a/src/utilities/isFlowFile.js +++ b/src/utilities/isFlowFile.js @@ -1,5 +1,5 @@ import isFlowFileAnnotation from './isFlowFileAnnotation'; -/* eslint-disable flowtype/require-valid-file-annotation */ + /** * Checks whether a file has an @flow or @noflow annotation. * @@ -7,7 +7,7 @@ import isFlowFileAnnotation from './isFlowFileAnnotation'; * @param [strict] - By default, the function returns true if the file starts with @flow but not if it * starts by @noflow. When the strict flag is set to false, the function returns true if the flag has @noflow also. */ -/* eslint-enable flowtype/require-valid-file-annotation */ + export default (context, strict = true) => { const comments = context.getAllComments(); diff --git a/src/utilities/isFlowFileAnnotation.js b/src/utilities/isFlowFileAnnotation.js index 0f111168..b9fa5810 100644 --- a/src/utilities/isFlowFileAnnotation.js +++ b/src/utilities/isFlowFileAnnotation.js @@ -3,7 +3,6 @@ import _ from 'lodash'; const FLOW_MATCHER = /^@(?:no)?flow$/; export default (comment, strict) => { - // eslint-disable-next-line flowtype/require-valid-file-annotation // The flow parser splits comments with the following regex to look for the @flow flag. // See https://github.com/facebook/flow/blob/a96249b93541f2f7bfebd8d62085bf7a75de02f2/src/parsing/docblock.ml#L39 return _.some(comment.split(/[ \t\r\n\\*/]+/), (commentPart) => {