Skip to content

Commit fb63342

Browse files
committed
remove flow and all flow checks
1 parent c2082e8 commit fb63342

File tree

7 files changed

+16
-487
lines changed

7 files changed

+16
-487
lines changed

.flowconfig

-51
This file was deleted.

babel.config.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
module.exports = {
22
"presets": [
3-
"@babel/preset-react",
4-
"@babel/preset-flow"
3+
"@babel/preset-react"
54
],
65
"plugins": [
76
"@babel/plugin-proposal-object-rest-spread",

package.json

+1-7
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@
6666
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
6767
"@babel/plugin-transform-runtime": "^7.11.5",
6868
"@babel/preset-env": "^7.11.5",
69-
"@babel/preset-flow": "^7.10.4",
7069
"@babel/preset-react": "^7.10.4",
7170
"@babel/register": "^7.11.5",
7271
"amphtml-validator": "^1.0.21",
@@ -92,8 +91,6 @@
9291
"eslint-config-airbnb": "^16.1.0",
9392
"eslint-config-prettier": "^2.9.0",
9493
"eslint-import-resolver-webpack": "^0.10.0",
95-
"eslint-plugin-flow-header": "^0.2.0",
96-
"eslint-plugin-flowtype": "^2.49.0",
9794
"eslint-plugin-guardian-frontend": "file:tools/eslint-plugin-guardian-frontend",
9895
"eslint-plugin-import": "^2.12.0",
9996
"eslint-plugin-jasmine": "^2.10.1",
@@ -102,8 +99,6 @@
10299
"eslint-plugin-react": "^7.8.2",
103100
"execa": "^0.8.0",
104101
"figures": "^2.0.0",
105-
"flow-bin": "^0.89.0",
106-
"flow-typed": "^2.5.1",
107102
"glob": "^7.1.2",
108103
"gzip-size": "^3.0.0",
109104
"hasha": "^3.0.0",
@@ -182,7 +177,6 @@
182177
"scripts": {
183178
"postinstall": "./tools/sync-githooks.js",
184179
"eslint-fix": "eslint --color --fix",
185-
"flow": "flow",
186180
"test": "jest"
187181
},
188182
"prettier": {
@@ -191,6 +185,6 @@
191185
"bracketSpacing": true,
192186
"tabWidth": 4,
193187
"jsxBracketSameLine": true,
194-
"parser": "flow"
188+
"parser": "babel"
195189
}
196190
}

static/src/javascripts/.eslintrc.js

+1-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// @flow
21
module.exports = {
32
env: {
43
browser: true,
@@ -13,11 +12,8 @@ module.exports = {
1312
'import/resolver': 'webpack',
1413
},
1514
extends: [
16-
'plugin:flowtype/recommended',
17-
'prettier/flowtype',
1815
'prettier/react',
1916
],
20-
plugins: ['flowtype', 'flow-header'],
2117
rules: {
2218
// require-specific overrides
2319
'import/extensions': 'off',
@@ -70,7 +66,6 @@ module.exports = {
7066
},
7167
],
7268

73-
'flow-header/flow-header': 'error',
7469
'no-param-reassign': ['error', { props: false }],
7570
'no-prototype-builtins': 'off',
7671

@@ -81,7 +76,7 @@ module.exports = {
8176
'guardian-frontend/no-default-export': 'warn',
8277
'guardian-frontend/no-direct-access-config': 'warn',
8378

84-
// flow should take care of our return values
79+
// flow (used to) take care of our return values (although, did it really?)
8580
'consistent-return': 'off',
8681
},
8782
};

tools/__tasks__/validate-head/javascript.js

-16
Original file line numberDiff line numberDiff line change
@@ -76,22 +76,6 @@ module.exports = {
7676
});
7777
}),
7878
},
79-
{
80-
description: 'Run Flowtype checks',
81-
task: () =>
82-
getChangedFiles().then(files => {
83-
const jsFiles = files.filter(
84-
file =>
85-
file.endsWith('.js') && file.startsWith('static')
86-
);
87-
88-
if (jsFiles.length) {
89-
return execa('yarn', ['flow']);
90-
}
91-
92-
return Promise.resolve();
93-
}),
94-
},
9579
],
9680
concurrent: true,
9781
};

tools/__tasks__/validate/javascript.js

+1-14
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
const fs = require('fs');
22

33
const chalk = require('chalk');
4-
const execa = require('execa');
54

65
const config = '--quiet --color';
76

@@ -16,21 +15,14 @@ const error = ctx => {
1615
);
1716
};
1817

19-
const flowError = ctx => {
20-
ctx.messages.push(
21-
`Your editor may be able to catch flow errors as you work:\n${chalk.underline(
22-
'https://flow.org/en/docs/editors'
23-
)}`
24-
);
25-
};
18+
2619
const dirs = p =>
2720
fs.readdirSync(p).filter(f => fs.statSync(`${p}/${f}`).isDirectory());
2821

2922
module.exports = {
3023
description: 'Lint JS',
3124
task: [
3225
...dirs('static/src/javascripts')
33-
.filter(dir => !['__flow__'].includes(dir))
3426
.map(dir => ({
3527
description: `App ${chalk.dim(dir)}`,
3628
task: `eslint static/src/javascripts/${dir} ${config}`,
@@ -41,11 +33,6 @@ module.exports = {
4133
task: `eslint --ignore-pattern /static/src --ignore-pattern . ${config}`,
4234
onError: error,
4335
},
44-
{
45-
description: 'Flow',
46-
task: () => execa('flow'),
47-
onError: flowError,
48-
},
4936
{
5037
description: 'Git hooks',
5138
task: `eslint git-hooks/* ${config}`,

0 commit comments

Comments
 (0)