Skip to content

Commit

Permalink
remove flow
Browse files Browse the repository at this point in the history
  • Loading branch information
koddsson committed Mar 17, 2020
1 parent 54e17c2 commit ae60a56
Show file tree
Hide file tree
Showing 18 changed files with 3 additions and 306 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -24,4 +24,4 @@ Set up `npm run lint` script.
}
```

The `github-lint` command will run `eslint`, `flow` and flow coverage checking depending on your project configuration.
The `github-lint` command will run various checkers and linters depending on your project configuration.
8 changes: 1 addition & 7 deletions bin/eslint-github-init.js
Expand Up @@ -18,9 +18,6 @@ if (fs.existsSync(packagePath)) {
const dependencies = Object.keys(packageJSON.dependencies || {})
const devDependencies = Object.keys(packageJSON.devDependencies || {})

if (dependencies.includes('flow-bin') || devDependencies.includes('flow-bin')) {
defaults.typeSystem = 'flow'
}
if (dependencies.includes('typescript') || devDependencies.includes('typescript')) {
defaults.typeSystem = 'typescript'
}
Expand All @@ -45,7 +42,7 @@ const questions = [
type: 'list',
name: 'typeSystem',
message: 'What type system are you using?',
choices: ['flow', 'typescript', 'none'],
choices: ['typescript', 'none'],
default: defaults.typeSystem
}
]
Expand All @@ -61,7 +58,6 @@ inquirer.prompt(questions).then(answers => {
eslintrc.extends.push('plugin:github/browser')
}

if (answers.typeSystem === 'flow') eslintrc.extends.push('plugin:github/flow')
if (answers.typeSystem === 'typescript') {
eslintrc.extends.push('plugin:github/typescript')
eslintrc.parser = '@typescript-eslint/parser'
Expand All @@ -85,8 +81,6 @@ inquirer.prompt(questions).then(answers => {
fs.writeFileSync(path.resolve(process.cwd(), '.eslintrc.json'), JSON.stringify(eslintrc, null, ' '), 'utf8')

const prettierConfig = []
if (answers.typeSystem === 'flow') prettierConfig.push('/* @flow */')

prettierConfig.push("module.exports = require('eslint-plugin-github/prettier.config')")
prettierConfig.push('')

Expand Down
119 changes: 0 additions & 119 deletions bin/flow-coverage.js

This file was deleted.

8 changes: 0 additions & 8 deletions bin/github-lint.js
Expand Up @@ -43,14 +43,6 @@ function execFile(command, args) {
commands.push(['tsc', ['--noEmit']])
}

if (fs.existsSync('.flowconfig')) {
commands.push(['flow', ['check']])
}

if (packageJson && packageJson.flow && packageJson.flow.coverageThreshold) {
commands.push(['flow-coverage', []])
}

for (const [command, args] of commands) {
if (runs > 0) process.stderr.write('\n')
process.stderr.write(`> ${command} ${args.join(' ')}\n`)
Expand Down
4 changes: 0 additions & 4 deletions docs/configs.md
Expand Up @@ -26,10 +26,6 @@ A base layer of configuration recommended for any JS project. The [Prettier](htt

Recommended rules when using Babel to transpile features from ES2015+.

### `plugin:github/flow`

Recommended rules for projects using the [Flow type checker](https://flow.org/).

### `plugin:github/app`

Recommended rules when writing a browser application.
Expand Down
1 change: 0 additions & 1 deletion docs/package-requirements.md
Expand Up @@ -20,4 +20,3 @@ Additional criteria for packages that are used at runtime rather than at build t
* MUST not declare specific polyfills in `package.json` `"dependencies"`. However, they MAY implicitly depend on polyfills already present in the environment.
* MUST not set or leak any global variables or monkey patch other object prototypes (with the exception of polyfills).
* Polyfill libraries MUST have an associated [Working Draft](https://www.w3.org/2004/02/Process-20040205/tr.html#first-wd) specification published by a standards body. Polyfills based on Editor's Draft are too early to implement and depend on.
* SHOULD provide [Flow](https://flowtype.org) type definitions.
3 changes: 0 additions & 3 deletions docs/rules/no-flow-weak.md

This file was deleted.

3 changes: 0 additions & 3 deletions docs/rules/no-noflow.md

This file was deleted.

14 changes: 0 additions & 14 deletions lib/configs/flow.js

This file was deleted.

4 changes: 0 additions & 4 deletions lib/index.js
Expand Up @@ -5,16 +5,13 @@ module.exports = {
'async-preventdefault': require('./rules/async-preventdefault'),
'authenticity-token': require('./rules/authenticity-token'),
'dependency-graph': require('./rules/dependency-graph'),
'flow-to-typescript': require('./rules/flow-to-typescript'),
'get-attribute': require('./rules/get-attribute'),
'js-class-name': require('./rules/js-class-name'),
'no-blur': require('./rules/no-blur'),
'no-d-none': require('./rules/no-d-none'),
'no-dataset': require('./rules/no-dataset'),
'no-flow-weak': require('./rules/no-flow-weak'),
'no-implicit-buggy-globals': require('./rules/no-implicit-buggy-globals'),
'no-innerText': require('./rules/no-innerText'),
'no-noflow': require('./rules/no-noflow'),
'no-then': require('./rules/no-then'),
'unescaped-html-literal': require('./rules/unescaped-html-literal'),
'unused-export': require('./rules/unused-export'),
Expand All @@ -24,7 +21,6 @@ module.exports = {
app: require('./configs/app'),
browser: require('./configs/browser'),
es6: require('./configs/es6'),
flow: require('./configs/flow'),
node: require('./configs/node'),
recommended: require('./configs/recommended'),
typescript: require('./configs/typescript')
Expand Down
18 changes: 0 additions & 18 deletions lib/rules/flow-to-typescript.js

This file was deleted.

24 changes: 0 additions & 24 deletions lib/rules/no-flow-weak.js

This file was deleted.

24 changes: 0 additions & 24 deletions lib/rules/no-noflow.js

This file was deleted.

14 changes: 0 additions & 14 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 1 addition & 5 deletions package.json
Expand Up @@ -10,7 +10,6 @@
"eslint-github-init": "bin/eslint-github-init.js",
"eslint-ignore-errors": "bin/eslint-ignore-errors.js",
"eslint-unused-modules": "bin/eslint-unused-modules.js",
"flow-coverage": "bin/flow-coverage.js",
"github-lint": "bin/github-lint.js",
"npm-check-github-package-requirements": "bin/npm-check-github-package-requirements.js"
},
Expand Down Expand Up @@ -38,7 +37,6 @@
"babel-eslint": ">=10.0.3",
"eslint-config-prettier": ">=6.4.0",
"eslint-plugin-eslint-comments": ">=3.0.1",
"eslint-plugin-flowtype": ">=4.3.0",
"eslint-plugin-import": ">=2.18.2",
"eslint-plugin-jsdoc": ">=15.5.2",
"eslint-plugin-prettier": ">=2.6.0",
Expand All @@ -50,8 +48,7 @@
"svg-element-attributes": ">=1.2.1"
},
"peerDependencies": {
"eslint": ">=4.19.0",
"flow-bin": ">=0.70.0"
"eslint": ">=4.19.0"
},
"files": [
"bin/*",
Expand All @@ -60,7 +57,6 @@
],
"devDependencies": {
"eslint": ">=6.5.1",
"flow-bin": ">=0.110.1",
"mocha": ">=6.2.2",
"rimraf": "^3.0.0"
}
Expand Down
19 changes: 0 additions & 19 deletions tests/flow-to-typescript.js

This file was deleted.

0 comments on commit ae60a56

Please sign in to comment.