Skip to content

Commit

Permalink
feat: update react-scripts (#721)
Browse files Browse the repository at this point in the history
* chore: update react-scripts

* chore: rebuild lock file

* chore: ensure react plugin is only loaded once

* chore: ignore import extension rule

* chore: remove unnecessary eslint disable

* refactor: move extends and ignorepatterns
  • Loading branch information
ismay committed Jun 21, 2022
1 parent 7e7d8ff commit dc1c5cb
Show file tree
Hide file tree
Showing 5 changed files with 4,347 additions and 4,239 deletions.
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',
},
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
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

0 comments on commit dc1c5cb

Please sign in to comment.