Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update top-level lint deps #1544

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .eslintrc

This file was deleted.

15 changes: 15 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"extends": "react-app",
"parserOptions": {
"ecmaVersion": 5,
"sourceType": "script",
"ecmaFeatures": {
"jsx": false,
"generators": true,
"impliedStrict": false
}
},
"rules": {
"strict": ["warn", "safe"]
}
}
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
"test": "node packages/react-scripts/scripts/test.js --env=jsdom"
},
"devDependencies": {
"babel-eslint": "6.1.2",
"eslint": "3.5.0",
"eslint-config-react-app": "0.2.1",
"eslint-plugin-flowtype": "2.18.1",
"eslint-plugin-import": "1.12.0",
"eslint-plugin-jsx-a11y": "2.2.2",
"eslint-plugin-react": "6.3.0",
"babel-eslint": "^7.1.1",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we enable ESLint's native support for async/await?
See note in https://github.com/babel/babel-eslint/releases/tag/v7.0.0.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a peerDep of our config, and we can't switch to ESLint's native support until import() lands.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See import-js/eslint-plugin-import#700.

The babel-eslint parser is required for it to be parsed properly (syntax parsing is not the job of an eslint plugin).

"eslint": "^3.15.0",
"eslint-config-react-app": "^0.5.1",
"eslint-plugin-flowtype": "^2.30.0",
"eslint-plugin-import": "^2.2.0",
"eslint-plugin-jsx-a11y": "^2.2.3",
"eslint-plugin-react": "^6.9.0",
"lerna": "^2.0.0-beta.37",
"lerna-changelog": "^0.2.3"
}
Expand Down
1 change: 1 addition & 0 deletions packages/babel-preset-react-app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/

'use strict';

var path = require('path');
Expand Down
2 changes: 2 additions & 0 deletions packages/eslint-config-react-app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
// In the future, we might create a separate list of rules for production.
// It would probably be more strict.

'use strict';

module.exports = {
root: true,

Expand Down
1 change: 1 addition & 0 deletions packages/react-dev-utils/InterpolateHtmlPlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
// https://github.com/ampedandwired/html-webpack-plugin#events

'use strict';

const escapeStringRegexp = require('escape-string-regexp');

class InterpolateHtmlPlugin {
Expand Down
2 changes: 2 additions & 0 deletions packages/react-dev-utils/checkRequiredFiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
* of patent rights can be found in the PATENTS file in the same directory.
*/

'use strict';

var fs = require('fs');
var path = require('path');
var chalk = require('chalk');
Expand Down
2 changes: 2 additions & 0 deletions packages/react-dev-utils/clearConsole.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
* of patent rights can be found in the PATENTS file in the same directory.
*/

'use strict';

function clearConsole() {
process.stdout.write(process.platform === 'win32' ? '\x1Bc' : '\x1B[2J\x1B[3J\x1B[H');
}
Expand Down
4 changes: 3 additions & 1 deletion packages/react-dev-utils/formatWebpackMessages.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
// This is quite hacky and hopefully won't be needed when Webpack fixes this.
// https://github.com/webpack/webpack/issues/2878

'use strict';

var friendlySyntaxErrorLabel = 'Syntax error:';

function isLikelyASyntaxError(message) {
Expand Down Expand Up @@ -106,7 +108,7 @@ function formatMessage(message) {
// from user code generated by WebPack. For more information see
// https://github.com/facebookincubator/create-react-app/pull/1050
message = message.replace(
/^\s*at\s((?!webpack:).)*:\d+:\d+[\s\)]*(\n|$)/gm, ''
/^\s*at\s((?!webpack:).)*:\d+:\d+[\s)]*(\n|$)/gm, ''
); // at ... ...:x:y

return message;
Expand Down
3 changes: 2 additions & 1 deletion packages/react-dev-utils/getProcessForPort.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var chalk = require('chalk');
var execSync = require('child_process').execSync;
var path = require('path');
Expand Down Expand Up @@ -58,4 +60,3 @@ function getProcessForPort(port) {
}

module.exports = getProcessForPort;

2 changes: 2 additions & 0 deletions packages/react-dev-utils/openBrowser.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
* of patent rights can be found in the PATENTS file in the same directory.
*/

'use strict';

var execSync = require('child_process').execSync;
var opn = require('opn');

Expand Down
2 changes: 2 additions & 0 deletions packages/react-dev-utils/prompt.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
* of patent rights can be found in the PATENTS file in the same directory.
*/

'use strict';

var rl = require('readline');

// Convention: "no" should be the conservative choice.
Expand Down
4 changes: 3 additions & 1 deletion packages/react-dev-utils/webpackHotDevClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
// that looks similar to our console output. The error overlay is inspired by:
// https://github.com/glenjamin/webpack-hot-middleware

'use strict';

var ansiHTML = require('ansi-html');
var SockJS = require('sockjs-client');
var stripAnsi = require('strip-ansi');
Expand Down Expand Up @@ -123,7 +125,7 @@ function showErrorOverlay(message) {
});
}

function destroyErrorOverlay() {
function destroyErrorOverlay() {
if (!overlayDiv) {
// It is not there in the first place.
return;
Expand Down
4 changes: 2 additions & 2 deletions packages/react-scripts/bin/react-scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ case 'test':
{stdio: 'inherit'}
);
if (result.signal) {
if (result.signal == 'SIGKILL') {
if (result.signal === 'SIGKILL') {
console.log(
'The build failed because the process exited too early. ' +
'This probably means the system ran out of memory or someone called ' +
'`kill -9` on the process.'
);
} else if (result.signal == 'SIGTERM') {
} else if (result.signal === 'SIGTERM') {
console.log(
'The build failed because the process exited too early. ' +
'Someone might have called `kill` or `killall`, or the system could ' +
Expand Down
1 change: 0 additions & 1 deletion packages/react-scripts/config/webpack.config.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ var HtmlWebpackPlugin = require('html-webpack-plugin');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var ManifestPlugin = require('webpack-manifest-plugin');
var InterpolateHtmlPlugin = require('react-dev-utils/InterpolateHtmlPlugin');
var url = require('url');
var paths = require('./paths');
var getClientEnvironment = require('./env');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ if (process.env.E2E_FILE) {
const markup = fs.readFileSync(file, 'utf8')
getMarkup = () => markup

const pathPrefix = process.env.PUBLIC_URL.replace(/^https?:\/\/[^\/]+\/?/, '')
const pathPrefix = process.env.PUBLIC_URL.replace(/^https?:\/\/[^/]+\/?/, '')

resourceLoader = (resource, callback) => callback(
null,
Expand Down
2 changes: 1 addition & 1 deletion tasks/e2e-simple.sh
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ then
fi

# Lint own code
./node_modules/.bin/eslint --ignore-path .gitignore ./
./node_modules/.bin/eslint --max-warnings 0 --ignore-path .gitignore ./

# ******************************************************************************
# First, test the create-react-app development environment.
Expand Down
1 change: 1 addition & 0 deletions tasks/replace-own-deps.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/

'use strict';

// Replaces internal dependencies in package.json with local package paths.
Expand Down