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

feat: update react-scripts #721

Merged
merged 6 commits into from
Jun 21, 2022
Merged
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: 3 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ module.exports = {
parserOptions: {
allowImportExportEverywhere: true,
},
rules: {
'import/extensions': 'off',
},
Comment on lines +8 to +10
Copy link
Contributor

Choose a reason for hiding this comment

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

Was wondering why we need that. Typescript?

Copy link
Member Author

Choose a reason for hiding this comment

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

#721 (comment)

I can take care of it after we've dealt with the functional part of these changes. Having it not block these changes makes it a little easier for me to integrate it with other tasks.

overrides: [
{
files: ['*.test.js'],
Expand Down
18 changes: 9 additions & 9 deletions shell/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
const fs = require('fs')
const path = require('path')

const eslintRunningLocally = process.cwd() === __dirname
// This should only exist when in development!
const rootConfigPath = path.resolve(__dirname, '../.eslintrc.js')

const delegateEslintConfig = path.resolve(__dirname, '../.eslintrc.js') // This should only exist when in development!
const shouldDelegate =
!eslintRunningLocally && fs.existsSync(delegateEslintConfig)
const isRunningHere = process.cwd() === __dirname
Mohammer5 marked this conversation as resolved.
Show resolved Hide resolved
const hasRootConfig = fs.existsSync(rootConfigPath)
const isDevelopment = !isRunningHere && hasRootConfig

const extendsList = shouldDelegate
? [delegateEslintConfig, 'react-app']
: 'react-app'
module.exports = {
ignorePatterns: shouldDelegate ? [] : ['src/D2App/*'],
extends: extendsList,
// Ignore app code that the dev has no control over
ignorePatterns: isDevelopment ? [] : ['src/D2App/*'],
// Use local config for developing this library, react-app preset for linting app code
extends: isDevelopment ? rootConfigPath : 'react-app',
}
2 changes: 1 addition & 1 deletion shell/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"prop-types": "^15.7.2",
"react": "^16.8.6",
"react-dom": "^16.8.6",
"react-scripts": "^5.0.0",
"react-scripts": "^5.0.1",
"source-map-explorer": "^2.1.0",
"styled-jsx": "^4.0.1",
"typeface-roboto": "^0.0.75",
Expand Down
2 changes: 0 additions & 2 deletions shell/public/service-worker.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-disable no-restricted-globals */

// A simple, no-op service worker that takes immediate control and tears
// everything down; has no fetch handler. Fixes apps with rogue service workers
// and gets overrwritten in apps using PWA
Expand Down
Loading