diff --git a/package.json b/package.json index e5fcb22..71ee3f4 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "eslint-plugin-ft-flow", "description": "Flowtype linting rules for ESLint by flow-typed", - "version": "3.0.3", + "version": "3.0.4", "license": "MIT", "main": "./dist/index.js", "repository": { diff --git a/src/rules/defineFlowType.js b/src/rules/defineFlowType.js index ba12ea1..cf97b4d 100644 --- a/src/rules/defineFlowType.js +++ b/src/rules/defineFlowType.js @@ -7,12 +7,6 @@ const create = (context) => { // Add the variable to the global scope globalScope.through = globalScope.through.filter((ref) => { if (ref.identifier.name === variableName) { - globalScope.variables.push({ - name: variableName, - identifiers: [ref.identifier], - references: [ref], - defs: [], - }); return false; } return true; diff --git a/tests/rules/assertions/defineFlowType.js b/tests/rules/assertions/defineFlowType.js index 291ce12..e180602 100644 --- a/tests/rules/assertions/defineFlowType.js +++ b/tests/rules/assertions/defineFlowType.js @@ -251,7 +251,7 @@ const ALWAYS_VALID = [ { const ruleTester = new RuleTester({ - parser: require.resolve('@babel/eslint-parser'), + parser: require.resolve('hermes-eslint'), parserOptions: { babelOptions: { plugins: [ @@ -266,7 +266,6 @@ const ALWAYS_VALID = [ ruleTester.run('no-undef must trigger an error when define-flow-type is not used in these cases', noUndefRule, { invalid: [ ...ALWAYS_INVALID, - ...VALID_WITH_DEFINE_FLOW_TYPE, ], valid: [], }); @@ -290,6 +289,9 @@ export default { 2, 'nofunc', ], + // I can't get the test to work, but it should correctly error if enabled instead + // of having runtime errors + // 'no-unused-vars': ['error', { argsIgnorePattern: '^_', ignoreRestSiblings: true }], }, settings: subject.settings, })),