Skip to content

Commit

Permalink
fix: styles
Browse files Browse the repository at this point in the history
  • Loading branch information
gajus committed May 15, 2020
1 parent 8f52ab8 commit fc5563d
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 19 deletions.
14 changes: 7 additions & 7 deletions package.json
Expand Up @@ -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",
Expand All @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion src/bin/checkDocs.js
Expand Up @@ -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.',
);
}
};
Expand Down
2 changes: 1 addition & 1 deletion src/bin/checkTests.js
Expand Up @@ -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.',
);
}
};
Expand Down
2 changes: 1 addition & 1 deletion src/rules/defineFlowType.js
Expand Up @@ -18,7 +18,7 @@ const create = (context) => {
globalScope.__defineGeneric(
ident.name,
globalScope.set,
globalScope.variables
globalScope.variables,
);
const variable = globalScope.set.get(ident.name);

Expand Down
6 changes: 3 additions & 3 deletions src/rules/newlineAfterFlowAnnotation.js
Expand Up @@ -25,7 +25,7 @@ const create = (context) => {
context.getAllComments(),
(comment) => {
return looksLikeFlowFileAnnotation(comment.value);
}
},
);

if (potentialFlowFileAnnotation) {
Expand All @@ -37,7 +37,7 @@ const create = (context) => {
fix: (fixer) => {
return fixer.insertTextAfter(
potentialFlowFileAnnotation,
newline
newline,
);
},
message: 'Expected newline after flow annotation',
Expand All @@ -57,7 +57,7 @@ const create = (context) => {
lineBreak === '\r' ? 2 : 1
),
],
''
'',
);
},
message: 'Expected no newline after flow annotation',
Expand Down
2 changes: 1 addition & 1 deletion src/rules/noDupeKeys.js
Expand Up @@ -52,7 +52,7 @@ const create = (context) => {
const element = analizeElement(
property.type === 'ObjectTypeSpreadProperty' ?
property.argument :
property.value
property.value,
);

return {
Expand Down
2 changes: 1 addition & 1 deletion src/rules/requireValidFileAnnotation.js
Expand Up @@ -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 + '`',
Expand Down
2 changes: 1 addition & 1 deletion src/rules/sortKeys.js
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions src/utilities/isFlowFile.js
@@ -1,13 +1,13 @@
import isFlowFileAnnotation from './isFlowFileAnnotation';
/* eslint-disable flowtype/require-valid-file-annotation */

/**
* Checks whether a file has an @flow or @noflow annotation.
*
* @param context
* @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();

Expand Down
1 change: 0 additions & 1 deletion src/utilities/isFlowFileAnnotation.js
Expand Up @@ -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) => {
Expand Down

0 comments on commit fc5563d

Please sign in to comment.