Skip to content
GitLab
    • Explore Projects Groups Snippets
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • C create-react-app
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,547
    • Issues 1,547
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 417
    • Merge requests 417
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Meta
  • create-react-app
  • Merge requests
  • !3828

Release

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Administrator requested to merge github/fork/Stinkstudios/release into next 7 years ago
  • Overview 0
  • Commits 101
  • Pipelines 0
  • Changes 229

Created by: andykenward

Compare
  • next (base)

and
  • latest version
    6b8314d9
    101 commits, 2 years ago

229 files
+ 1567
- 93739

    Preferences

    File browser
    Compare changes
pack‎ages‎
babel-prese‎t-react-app‎
READ‎ME.md‎ +0 -27
inde‎x.js‎ +0 -136
packag‎e.json‎ +0 -30
create-r‎eact-app‎
createRe‎actApp.js‎ +10 -4
eslint-conf‎ig-react-app‎
READ‎ME.md‎ +26 -44
inde‎x.js‎ +24 -166
packag‎e.json‎ +16 -10
react-d‎ev-utils‎
__te‎sts__‎
.esl‎intrc‎ +0 -5
ignoredFil‎es.test.js‎ +0 -55
FileSizeR‎eporter.js‎ +0 -141
InterpolateH‎tmlPlugin.js‎ +0 -44
ModuleScop‎ePlugin.js‎ +0 -81
READ‎ME.md‎ +0 -328
WatchMissingNode‎ModulesPlugin.js‎ +0 -35
WebpackDevSe‎rverUtils.js‎ +0 -435
checkRequi‎redFiles.js‎ +0 -32
clearCo‎nsole.js‎ +0 -16
crossS‎pawn.js‎ +0 -12
errorOverlay‎Middleware.js‎ +0 -21
eslintFor‎matter.js‎ +0 -92
formatWebpac‎kMessages.js‎ +0 -125
getProcess‎ForPort.js‎ +0 -82
ignored‎Files.js‎ +0 -19
inqui‎rer.js‎ +0 -12
launchE‎ditor.js‎ +0 -319
launchEdito‎rEndpoint.js‎ +0 -10
noopServiceWork‎erMiddleware.js‎ +0 -38
openBro‎wser.js‎ +0 -126
openChrome.‎applescript‎ +0 -83
packag‎e.json‎ +0 -64
printBuil‎dError.js‎ +0 -45
printHostingI‎nstructions.js‎ +0 -136
webpackHotD‎evClient.js‎ +0 -272
react-err‎or-overlay‎
fixt‎ures‎
bundle-de‎fault.json‎ +0 -86
bundl‎e.json‎ +0 -518
bundl‎e.mjs‎ +0 -41224
bundle.‎mjs.map‎ +0 -1
bundle‎2.json‎ +0 -122
bundle‎_u.mjs‎ +0 -41488
bundle_u‎.mjs.map‎ +0 -1
inline.‎es6.mjs‎ +0 -5
inlin‎e.mjs‎ +0 -12
junk-in‎line.mjs‎ +0 -12
s‎rc‎
__te‎sts__‎
__snap‎shots__‎
lines-arou‎nd.js.snap‎ +0 -61
script-lin‎es.js.snap‎ +0 -17
stack-fra‎me.js.snap‎ +0 -31
unmapper‎.js.snap‎ +0 -102
par‎ser‎
__snap‎shots__‎
chrome.‎js.snap‎ +0 -54
firefox‎.js.snap‎ +0 -230
react.‎js.snap‎ +0 -54
safari.‎js.snap‎ +0 -42
chro‎me.js‎ +0 -20
firef‎ox.js‎ +0 -60
gener‎ic.js‎ +0 -30
reac‎t.js‎ +0 -20
safa‎ri.js‎ +0 -20
extract-so‎urce-map.js‎ +0 -30
get-sour‎ce-map.js‎ +0 -63
lines-a‎round.js‎ +0 -18
mapp‎er.js‎ +0 -84
script-‎lines.js‎ +0 -16
setupJ‎est.js‎ +0 -8
stack-f‎rame.js‎ +0 -36
unmap‎per.js‎ +0 -72
compo‎nents‎
CloseBu‎tton.js‎ +0 -36
CodeBl‎ock.js‎ +0 -52
Collaps‎ible.js‎ +0 -86
ErrorOv‎erlay.js‎ +0 -83
Foot‎er.js‎ +0 -34
Head‎er.js‎ +0 -33
Navigati‎onBar.js‎ +0 -68
conta‎iners‎
CompileError‎Container.js‎ +0 -49
Runtime‎Error.js‎ +0 -68
RuntimeError‎Container.js‎ +0 -89
StackF‎rame.js‎ +0 -191
StackFrameC‎odeBlock.js‎ +0 -95
StackT‎race.js‎ +0 -94
eff‎ects‎
proxyCo‎nsole.js‎ +0 -70
stackTrac‎eLimit.js‎ +0 -43
unhandle‎dError.js‎ +0 -47
unhandledR‎ejection.js‎ +0 -53
ut‎ils‎
d‎om‎
absolutif‎yCaret.js‎ +0 -41
css‎.js‎ +0 -47
generateA‎nsiHTML.js‎ +0 -106
getLines‎Around.js‎ +0 -37
getPret‎tyURL.js‎ +0 -47
getSour‎ceMap.js‎ +0 -128
getStack‎Frames.js‎ +0 -48
isBultinEr‎rorName.js‎ +0 -25
isIntern‎alFile.js‎ +0 -21
mapp‎er.js‎ +0 -69
parseCompi‎leError.js‎ +0 -57
pars‎er.js‎ +0 -91
pollyf‎ills.js‎ +0 -18
stack-f‎rame.js‎ +0 -120
unmap‎per.js‎ +0 -126
warni‎ngs.js‎ +0 -54
iframeS‎cript.js‎ +0 -62
inde‎x.js‎ +0 -176
listenToRunt‎imeErrors.js‎ +0 -84
styl‎es.js‎ +0 -54
.bab‎elrc‎ +0 -3
.esl‎intrc‎ +0 -6
.flow‎config‎ +0 -9
.gitatt‎ributes‎ +0 -1
.giti‎gnore‎ +0 -2
.npmi‎gnore‎ +0 -3
READ‎ME.md‎ +0 -11
buil‎d.js‎ +0 -95
packag‎e.json‎ +0 -81
webpack.conf‎ig.iframe.js‎ +0 -48
webpack.‎config.js‎ +0 -37
react-‎scripts‎
b‎in‎
react-sc‎ripts.js‎ +1 -0
con‎fig‎
je‎st‎
babelTra‎nsform.js‎ +0 -15
css-tran‎sform.js‎ +1 -1
file-tra‎nsform.js‎ +1 -1
env‎.js‎ +22 -0
path‎s.js‎ +3 -0
webpack-dev-se‎rver.config.js‎ +7 -2
webpack.co‎nfig.dev.js‎ +35 -29
webpack.con‎fig.prod.js‎ +95 -36
fixtures/k‎itchensink‎
integ‎ration‎
initD‎OM.js‎ +5 -8
webpack‎.test.js‎ +3 -3
s‎rc‎
feat‎ures‎
e‎nv‎
file-env-v‎ariables.js‎ +0 -0
file-env-vari‎ables.test.js‎ +1 -1
node-p‎ath.js‎ +1 -1
node-pat‎h.test.js‎ +1 -1
public‎-url.js‎ +0 -0
public-ur‎l.test.js‎ +1 -1
shell-env-v‎ariables.js‎ +0 -0
shell-env-var‎iables.test.js‎ +1 -1
syn‎tax‎
array-destr‎ucturing.js‎ +0 -0
array-destruc‎turing.test.js‎ +1 -1
array-s‎pread.js‎ +0 -0
array-spre‎ad.test.js‎ +1 -1
async-a‎wait.js‎ +0 -0
async-awa‎it.test.js‎ +1 -1
class-pro‎perties.js‎ +4 -4
class-proper‎ties.test.js‎ +1 -1
computed-pr‎operties.js‎ +0 -0
computed-prop‎erties.test.js‎ +1 -1
custom-inte‎rpolation.js‎ +0 -0
custom-interpo‎lation.test.js‎ +1 -1
default-pa‎rameters.js‎ +0 -0
default-param‎eters.test.js‎ +1 -1
destructuring‎-and-await.js‎ +0 -0
destructuring-a‎nd-await.test.js‎ +1 -1
genera‎tors.js‎ +2 -2
generator‎s.test.js‎ +1 -1
object-dest‎ructuring.js‎ +0 -0
object-destruc‎turing.test.js‎ +1 -1
object-s‎pread.js‎ +0 -0
object-spr‎ead.test.js‎ +1 -1
promi‎ses.js‎ +0 -0
promises‎.test.js‎ +1 -1
rest-and-‎default.js‎ +0 -0
rest-and-def‎ault.test.js‎ +1 -1
rest-para‎meters.js‎ +0 -0
rest-parame‎ters.test.js‎ +1 -1
template-int‎erpolation.js‎ +0 -0
template-interp‎olation.test.js‎ +1 -1
web‎pack‎
ass‎ets‎
a-file-with‎-ext.unknown‎ +0 -0
a-file-wi‎thout-ext‎ +0 -0
styl‎e.css‎ +2 -2
css-incl‎usion.js‎ +3 -1
css-inclus‎ion.test.js‎ +1 -1
image-inc‎lusion.js‎ +0 -0
image-inclu‎sion.test.js‎ +1 -1
json-inc‎lusion.js‎ +0 -0
json-inclus‎ion.test.js‎ +1 -1
linked-m‎odules.js‎ +2 -1
linked-modu‎les.test.js‎ +1 -1
no-ext-in‎clusion.js‎ +1 -1
no-ext-inclu‎sion.test.js‎ +1 -1
svg-incl‎usion.js‎ +0 -0
svg-inclus‎ion.test.js‎ +1 -1
unknown-ext-‎inclusion.js‎ +1 -1
unknown-ext-in‎clusion.test.js‎ +1 -1
absolute‎-load.js‎ +0 -0
app‎.js‎ +28 -26
inde‎x.js‎ +1 -1
.esl‎intrc‎ +12 -0
.template.dep‎endencies.json‎ +1 -1
READ‎ME.md‎ +1 -1
scr‎ipts‎
ut‎ils‎
create-jes‎t-config.js‎ +4 -3
ejec‎t.js‎ +1 -13
ini‎t.js‎ +43 -2
lin‎t.js‎ +31 -0
star‎t.js‎ +1 -1
tes‎t.js‎ +1 -1
temp‎late‎
s‎rc‎
app‎.css‎ +13 -9
app‎.js‎ +21 -0
app.t‎est.js‎ +1 -1
inde‎x.css‎ +1 -1
inde‎x.js‎ +8 -2
register-serv‎ice-worker.js‎ +1 -0
sent‎ry.js‎ +21 -0
vendo‎rs.js‎ +2 -0
.edito‎rconfig‎ +17 -0
READ‎ME.md‎ +193 -72
giti‎gnore‎ +1 -0
packag‎e.json‎ +87 -22
stylelint-con‎fig-react-app‎
__te‎sts__‎
css-inv‎alid.css‎ +3 -0
css-va‎lid.css‎ +10 -0
inde‎x.js‎ +78 -0
LIC‎ENSE‎ +21 -0
READ‎ME.md‎ +51 -0
browse‎rslist‎ +4 -0
inde‎x.js‎ +99 -0
no-unsupported-br‎owser-features.js‎ +9 -0
orde‎r.js‎ +26 -0
packag‎e.json‎ +50 -0
propertie‎s-order.js‎ +296 -0
ta‎sks‎
cra‎.sh‎ +1 -1
e2e-ins‎talls.sh‎ +14 -4
e2e-kitch‎ensink.sh‎ +7 -17
e2e-si‎mple.sh‎ +21 -25
local-‎test.sh‎ +1 -1
relea‎se.sh‎ +0 -4
temp‎late‎
READ‎ME.md‎ +0 -4
.giti‎gnore‎ +1 -0
.trav‎is.yml‎ +2 -11
CHANGELO‎G-0.x.md‎ +0 -1374
CHANGE‎LOG.md‎ +15 -1462
READ‎ME.md‎ +51 -50
appvey‎or.yml‎ +3 -9
lerna‎.json‎ +3 -2
packag‎e.json‎ +6 -5
renova‎te.json‎ +14 -0
packages/babel-preset-react-app/README.md deleted 100644 → 0
+ 0
- 27
  • View file @ 4bec8771

# babel-preset-react-app
This package includes the Babel preset used by [Create React App](https://github.com/facebookincubator/create-react-app).<br>
Please refer to its documentation:
* [Getting Started](https://github.com/facebookincubator/create-react-app/blob/master/README.md#getting-started) – How to create a new app.
* [User Guide](https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md) – How to develop apps bootstrapped with Create React App.
## Usage in Create React App Projects
The easiest way to use this configuration is with [Create React App](https://github.com/facebookincubator/create-react-app), which includes it by default. **You don’t need to install it separately in Create React App projects.**
## Usage Outside of Create React App
If you want to use this Babel preset in a project not built with Create React App, you can install it with following steps.
First, [install Babel](https://babeljs.io/docs/setup/).
Then create a file named `.babelrc` with following contents in the root folder of your project:
```js
{
"presets": ["react-app"]
}
```
This preset uses the `useBuiltIns` option with [transform-object-rest-spread](http://babeljs.io/docs/plugins/transform-object-rest-spread/) and [transform-react-jsx](http://babeljs.io/docs/plugins/transform-react-jsx/), which assumes that `Object.assign` is available or polyfilled.
packages/babel-preset-react-app/index.js deleted 100644 → 0
+ 0
- 136
  • View file @ 4bec8771

/**
* Copyright (c) 2015-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
'use strict';
const plugins = [
// class { handleClick = () => { } }
require.resolve('babel-plugin-transform-class-properties'),
// The following two plugins use Object.assign directly, instead of Babel's
// extends helper. Note that this assumes `Object.assign` is available.
// { ...todo, completed: true }
[
require.resolve('babel-plugin-transform-object-rest-spread'),
{
useBuiltIns: true,
},
],
// Transforms JSX
[
require.resolve('babel-plugin-transform-react-jsx'),
{
useBuiltIns: true,
},
],
// Polyfills the runtime needed for async/await and generators
[
require.resolve('babel-plugin-transform-runtime'),
{
helpers: false,
polyfill: false,
regenerator: true,
},
],
];
// This is similar to how `env` works in Babel:
// https://babeljs.io/docs/usage/babelrc/#env-option
// We are not using `env` because it’s ignored in versions > babel-core@6.10.4:
// https://github.com/babel/babel/issues/4539
// https://github.com/facebookincubator/create-react-app/issues/720
// It’s also nice that we can enforce `NODE_ENV` being specified.
var env = process.env.BABEL_ENV || process.env.NODE_ENV;
if (env !== 'development' && env !== 'test' && env !== 'production') {
throw new Error(
'Using `babel-preset-react-app` requires that you specify `NODE_ENV` or ' +
'`BABEL_ENV` environment variables. Valid values are "development", ' +
'"test", and "production". Instead, received: ' +
JSON.stringify(env) +
'.'
);
}
if (env === 'development' || env === 'test') {
// The following two plugins are currently necessary to make React warnings
// include more valuable information. They are included here because they are
// currently not enabled in babel-preset-react. See the below threads for more info:
// https://github.com/babel/babel/issues/4702
// https://github.com/babel/babel/pull/3540#issuecomment-228673661
// https://github.com/facebookincubator/create-react-app/issues/989
plugins.push.apply(plugins, [
// Adds component stack to warning messages
require.resolve('babel-plugin-transform-react-jsx-source'),
// Adds __self attribute to JSX which React will use for some warnings
require.resolve('babel-plugin-transform-react-jsx-self'),
]);
}
if (env === 'test') {
module.exports = {
presets: [
// ES features necessary for user's Node version
[
require('babel-preset-env').default,
{
targets: {
node: 'current',
},
},
],
// JSX, Flow
require.resolve('babel-preset-react'),
],
plugins: plugins.concat([
// Compiles import() to a deferred require()
require.resolve('babel-plugin-dynamic-import-node'),
]),
};
} else {
module.exports = {
presets: [
// Latest stable ECMAScript features
[
require.resolve('babel-preset-env'),
{
targets: {
// React parses on ie 9, so we should too
ie: 9,
// We currently minify with uglify
// Remove after https://github.com/mishoo/UglifyJS2/issues/448
uglify: true,
},
// Disable polyfill transforms
useBuiltIns: false,
// Do not transform modules to CJS
modules: false,
},
],
// JSX, Flow
require.resolve('babel-preset-react'),
],
plugins: plugins.concat([
// function* () { yield 42; yield 43; }
[
require.resolve('babel-plugin-transform-regenerator'),
{
// Async functions are converted to generators by babel-preset-env
async: false,
},
],
// Adds syntax support for import()
require.resolve('babel-plugin-syntax-dynamic-import'),
]),
};
if (env === 'production') {
// Optimization: hoist JSX that never changes out of render()
// Disabled because of issues: https://github.com/facebookincubator/create-react-app/issues/553
// TODO: Enable again when these issues are resolved.
// plugins.push.apply(plugins, [
// require.resolve('babel-plugin-transform-react-constant-elements')
// ]);
}
}
packages/babel-preset-react-app/package.json deleted 100644 → 0
+ 0
- 30
  • View file @ 4bec8771

{
"name": "babel-preset-react-app",
"version": "3.1.0",
"description": "Babel preset used by Create React App",
"repository": "facebookincubator/create-react-app",
"license": "MIT",
"bugs": {
"url": "https://github.com/facebookincubator/create-react-app/issues"
},
"files": [
"index.js"
],
"dependencies": {
"babel-plugin-dynamic-import-node": "1.1.0",
"babel-plugin-syntax-dynamic-import": "6.18.0",
"babel-plugin-transform-class-properties": "6.24.1",
"babel-plugin-transform-object-rest-spread": "6.26.0",
"babel-plugin-transform-react-constant-elements": "6.23.0",
"babel-plugin-transform-react-jsx": "6.24.1",
"babel-plugin-transform-react-jsx-self": "6.22.0",
"babel-plugin-transform-react-jsx-source": "6.22.0",
"babel-plugin-transform-regenerator": "6.26.0",
"babel-plugin-transform-runtime": "6.23.0",
"babel-preset-env": "1.6.1",
"babel-preset-react": "6.24.1"
},
"peerDependencies": {
"babel-runtime": "^6.23.0"
}
}
packages/create-react-app/createReactApp.js
+ 10
- 4
  • View file @ 6b8314d9


@@ -64,6 +64,7 @@ const program = new commander.Command(packageJson.name)
'--scripts-version <alternative-package>',
'use a non-standard version of react-scripts'
)
.option('--use-npm')
.allowUnknownOption()
.on('--help', () => {
console.log(` Only ${chalk.green('<project-directory>')} is required.`);
@@ -133,10 +134,11 @@ createApp(
projectName,
program.verbose,
program.scriptsVersion,
program.useNpm,
hiddenProgram.internalTestingTemplate
);
function createApp(name, verbose, version, template) {
function createApp(name, verbose, version, useNpm, template) {
const root = path.resolve(name);
const appName = path.basename(root);
@@ -159,7 +161,7 @@ function createApp(name, verbose, version, template) {
JSON.stringify(packageJson, null, 2)
);
const useYarn = shouldUseYarn();
const useYarn = useNpm ? false : shouldUseYarn();
const originalDirectory = process.cwd();
process.chdir(root);
if (!useYarn && !checkThatNpmCanReadCwd()) {
@@ -169,7 +171,9 @@ function createApp(name, verbose, version, template) {
if (!semver.satisfies(process.version, '>=6.0.0')) {
console.log(
chalk.yellow(
`You are using Node ${process.version} so the project will be bootstrapped with an old unsupported version of tools.\n\n` +
`You are using Node ${
process.version
} so the project will be bootstrapped with an old unsupported version of tools.\n\n` +
`Please update to Node 6 or higher for a better, fully supported experience.\n`
)
);
@@ -183,7 +187,9 @@ function createApp(name, verbose, version, template) {
if (npmInfo.npmVersion) {
console.log(
chalk.yellow(
`You are using npm ${npmInfo.npmVersion} so the project will be boostrapped with an old unsupported version of tools.\n\n` +
`You are using npm ${
npmInfo.npmVersion
} so the project will be boostrapped with an old unsupported version of tools.\n\n` +
`Please update to npm 3 or higher for a better, fully supported experience.\n`
)
);
packages/eslint-config-react-app/README.md
+ 26
- 44
  • View file @ 6b8314d9

# eslint-config-react-app
# @stinkstudios/eslint-config-react-app
This package includes the shareable ESLint configuration used by [Create React App](https://github.com/facebookincubator/create-react-app).<br>
This package includes the shareable ESLint configuration used by [@stinkstudios/create-react-app](https://github.com/stinkstudios/create-react-app).<br>
Please refer to its documentation:
* [Getting Started](https://github.com/facebookincubator/create-react-app/blob/master/README.md#getting-started) – How to create a new app.
* [User Guide](https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md) – How to develop apps bootstrapped with Create React App.
* [Getting Started](https://github.com/stinkstudios/create-react-app/blob/master/README.md#getting-started) – How to create a new app.
* [User Guide](https://github.com/stinkstudios/create-react-app/blob/master/packages/react-scripts/template/README.md) – How to develop apps bootstrapped with Create React App.
## Usage in Create React App Projects
The easiest way to use this configuration is with [Create React App](https://github.com/facebookincubator/create-react-app), which includes it by default.
The easiest way to use this configuration is with [@stinkstudios/create-react-app](https://github.com/stinkstudios/create-react-app), which includes it by default.
**You don’t need to install it separately in Create React App projects.**
**You don’t need to install it separately in @stinkstudios Create React App projects.**
## Usage Outside of Create React App
## Usage Outside of @stinkstudios Create React App
If you want to use this ESLint configuration in a project not built with Create React App, you can install it with following steps.
If you want to use this ESLint configuration in a project not built with @stinkstudios Create React App, you can install it with following steps.
First, install this package, ESLint and the necessary plugins.
```sh
npm install --save-dev eslint-config-react-app babel-eslint@^7.2.3 eslint@^4.1.1 eslint-plugin-flowtype@^2.34.1 eslint-plugin-import@^2.6.0 eslint-plugin-jsx-a11y@^5.1.1 eslint-plugin-react@^7.1.0
npm install --save-dev @stinkstudios/eslint-config-react-app babel-eslint@^8.0.2 eslint@^4.11.0 eslint-plugin-flowtype@^2.39.1 eslint-plugin-import@^2.8.0 eslint-plugin-jsx-a11y@^6.0.2 eslint-plugin-react@^7.5.1 eslint-plugin-compat@^2.1.0 eslint-plugin-unicorn@^3.0.1
```
Then create a file named `.eslintrc` with following contents in the root folder of your project:
```js
{
"extends": "react-app"
"extends": "@stinkstudios/eslint-config-react-app"
}
```
That's it! You can override the settings from `eslint-config-react-app` by editing the `.eslintrc` file. Learn more about [configuring ESLint](http://eslint.org/docs/user-guide/configuring) on the ESLint website.
## Accessibility Checks
The following rules from the [eslint-plugin-jsx-a11y](https://github.com/evcohen/eslint-plugin-jsx-a11y) plugin are activated:
- [accessible-emoji](https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/accessible-emoji.md)
- [alt-text](https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/alt-text.md)
- [anchor-has-content](https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/anchor-has-content.md)
- [aria-activedescendant-has-tabindex](https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/aria-activedescendant-has-tabindex.md)
- [aria-props](https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/aria-props.md)
- [aria-proptypes](https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/aria-proptypes.md)
- [aria-role](https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/aria-role.md)
- [aria-unsupported-elements](https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/aria-unsupported-elements.md)
- [heading-has-content](https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/heading-has-content.md)
- [href-no-hash](https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/href-no-hash.md)
- [iframe-has-title](https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/iframe-has-title.md)
- [img-redundant-alt](https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/img-redundant-alt.md)
- [no-access-key](https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/no-access-key.md)
- [no-distracting-elements](https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/no-distracting-elements.md)
- [no-redundant-roles](https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/no-redundant-roles.md)
- [role-has-required-aria-props](https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/role-has-required-aria-props.md)
- [role-supports-aria-props](https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/role-supports-aria-props.md)
- [scope](https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/scope.md)
If you want to enable even more accessibility rules, you can create an `.eslintrc` file in the root of your project with this content:
```json
{
"extends": ["react-app", "plugin:jsx-a11y/recommended"],
"plugins": ["jsx-a11y"]
}
```
That's it! You can override the settings from `@stinkstudios/eslint-config-react-app` by editing the `.eslintrc` file. Learn more about [configuring ESLint](http://eslint.org/docs/user-guide/configuring) on the ESLint website.
## ESLint Plugins
- [`eslint-plugin-compat`](https://github.com/amilajack/eslint-plugin-compat/tree/v2.1.0)
- [`eslint-plugin-flowtype`](https://github.com/gajus/eslint-plugin-flowtype/tree/v2.39.1)
- [`eslint-plugin-import`](https://github.com/benmosher/eslint-plugin-import/)
- [`eslint-plugin-jsx-a11y`](https://github.com/evcohen/eslint-plugin-jsx-a11y/tree/v6.0.2)
- [`eslint-plugin-react`](https://github.com/yannickcr/eslint-plugin-react/tree/v7.5.1)
- [`eslint-plugin-unicorn`](https://github.com/sindresorhus/eslint-plugin-unicorn)
## ESLint Configs
- [`eslint-config-airbnb`](https://github.com/airbnb/javascript/tree/eslint-config-airbnb-v16.1.0)
- [`eslint-config-prettier`](https://github.com/prettier/eslint-config-prettier/tree/v2.8.0)
However, if you are using [Create React App](https://github.com/facebookincubator/create-react-app) and have not ejected, any additional rules will only be displayed in the [IDE integrations](https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md#displaying-lint-output-in-the-editor), but not in the browser or the terminal.
[IDE integrations](https://github.com/stinkstudios/create-react-app/blob/master/packages/react-scripts/template/README.md#displaying-lint-output-in-the-editor), but not in the browser or the terminal.
packages/eslint-config-react-app/index.js
+ 24
- 166
  • View file @ 6b8314d9


@@ -87,7 +87,15 @@ module.exports = {
parser: 'babel-eslint',
plugins: ['import', 'flowtype', 'jsx-a11y', 'react'],
extends: [
'airbnb',
'plugin:jsx-a11y/recommended',
'prettier',
'prettier/flowtype',
'prettier/react',
],
plugins: ['import', 'flowtype', 'jsx-a11y', 'react', 'compat', 'unicorn'],
env: {
browser: true,
@@ -108,92 +116,11 @@ module.exports = {
},
rules: {
// http://eslint.org/docs/rules/
'array-callback-return': 'warn',
'default-case': ['warn', { commentPattern: '^no default$' }],
'dot-location': ['warn', 'property'],
eqeqeq: ['warn', 'allow-null'],
'new-parens': 'warn',
'no-array-constructor': 'warn',
'no-caller': 'warn',
'no-cond-assign': ['warn', 'always'],
'no-const-assign': 'warn',
'no-control-regex': 'warn',
'no-delete-var': 'warn',
'no-dupe-args': 'warn',
'no-dupe-class-members': 'warn',
'no-dupe-keys': 'warn',
'no-duplicate-case': 'warn',
'no-empty-character-class': 'warn',
'no-empty-pattern': 'warn',
'no-eval': 'warn',
'no-ex-assign': 'warn',
'no-extend-native': 'warn',
'no-extra-bind': 'warn',
'no-extra-label': 'warn',
'no-fallthrough': 'warn',
'no-func-assign': 'warn',
'no-implied-eval': 'warn',
'no-invalid-regexp': 'warn',
'no-iterator': 'warn',
'no-label-var': 'warn',
'no-labels': ['warn', { allowLoop: true, allowSwitch: false }],
'no-lone-blocks': 'warn',
'no-loop-func': 'warn',
'no-mixed-operators': [
'warn',
{
groups: [
['&', '|', '^', '~', '<<', '>>', '>>>'],
['==', '!=', '===', '!==', '>', '>=', '<', '<='],
['&&', '||'],
['in', 'instanceof'],
],
allowSamePrecedence: false,
},
],
'no-multi-str': 'warn',
'no-native-reassign': 'warn',
'no-negated-in-lhs': 'warn',
'no-new-func': 'warn',
'no-new-object': 'warn',
'no-new-symbol': 'warn',
'no-new-wrappers': 'warn',
'no-obj-calls': 'warn',
'no-octal': 'warn',
'no-octal-escape': 'warn',
'no-redeclare': 'warn',
'no-regex-spaces': 'warn',
'no-restricted-syntax': ['warn', 'WithStatement'],
'no-script-url': 'warn',
'no-self-assign': 'warn',
'no-self-compare': 'warn',
'no-sequences': 'warn',
'no-shadow-restricted-names': 'warn',
'no-sparse-arrays': 'warn',
'no-template-curly-in-string': 'warn',
'no-this-before-super': 'warn',
'no-throw-literal': 'warn',
'no-undef': 'error',
// https://github.com/benmosher/eslint-plugin-import/tree/master/docs/rules
'class-methods-use-this': 0,
'global-require': 0,
'no-console': 0,
'no-restricted-globals': ['error'].concat(restrictedGlobals),
'no-unexpected-multiline': 'warn',
'no-unreachable': 'warn',
'no-unused-expressions': [
'warn',
{
allowShortCircuit: true,
allowTernary: true,
allowTaggedTemplates: true,
},
],
'no-unused-labels': 'warn',
'no-unused-vars': [
'warn',
{
args: 'none',
ignoreRestSiblings: true,
},
],
'no-use-before-define': [
'warn',
{
@@ -202,94 +129,25 @@ module.exports = {
variables: false,
},
],
'no-useless-computed-key': 'warn',
'no-useless-concat': 'warn',
'no-useless-constructor': 'warn',
'no-useless-escape': 'warn',
'no-useless-rename': [
'warn',
{
ignoreDestructuring: false,
ignoreImport: false,
ignoreExport: false,
},
],
'no-with': 'warn',
'no-whitespace-before-property': 'warn',
radix: 'warn',
'require-yield': 'warn',
'rest-spread-spacing': ['warn', 'never'],
strict: ['warn', 'never'],
'unicode-bom': ['warn', 'never'],
'use-isnan': 'warn',
'valid-typeof': 'warn',
'no-restricted-properties': [
'error',
// TODO: reenable once import() is no longer slow.
// https://github.com/facebookincubator/create-react-app/issues/2176
// {
// object: 'require',
// property: 'ensure',
// message: 'Please use import() instead. More info: https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md#code-splitting',
// },
{
object: 'System',
property: 'import',
message:
'Please use import() instead. More info: https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md#code-splitting',
},
],
// https://github.com/benmosher/eslint-plugin-import/tree/master/docs/rules
'import/first': 'error',
'import/no-amd': 'error',
'import/no-webpack-loader-syntax': 'error',
// https://github.com/yannickcr/eslint-plugin-react/tree/master/docs/rules
'react/jsx-no-comment-textnodes': 'warn',
'react/jsx-no-duplicate-props': ['warn', { ignoreCase: true }],
'react/jsx-no-target-blank': 'warn',
'react/jsx-no-undef': 'error',
'react/jsx-pascal-case': [
'warn',
{
allowAllCaps: true,
ignore: [],
},
],
'react/jsx-uses-react': 'warn',
'react/jsx-uses-vars': 'warn',
'react/no-danger-with-children': 'warn',
'react/no-deprecated': 'warn',
'react/no-direct-mutation-state': 'warn',
'react/no-is-mounted': 'warn',
'react/react-in-jsx-scope': 'error',
'react/require-render-return': 'error',
'react/style-prop-object': 'warn',
'react/jsx-filename-extension': 0,
'react/prefer-stateless-function': 0,
// https://github.com/evcohen/eslint-plugin-jsx-a11y/tree/master/docs/rules
'jsx-a11y/accessible-emoji': 'warn',
'jsx-a11y/alt-text': 'warn',
'jsx-a11y/anchor-has-content': 'warn',
'jsx-a11y/aria-activedescendant-has-tabindex': 'warn',
'jsx-a11y/aria-props': 'warn',
'jsx-a11y/aria-proptypes': 'warn',
'jsx-a11y/aria-role': 'warn',
'jsx-a11y/aria-unsupported-elements': 'warn',
'jsx-a11y/heading-has-content': 'warn',
'jsx-a11y/href-no-hash': 'warn',
'jsx-a11y/iframe-has-title': 'warn',
'jsx-a11y/img-redundant-alt': 'warn',
'jsx-a11y/no-access-key': 'warn',
'jsx-a11y/no-distracting-elements': 'warn',
'jsx-a11y/no-redundant-roles': 'warn',
'jsx-a11y/role-has-required-aria-props': 'warn',
'jsx-a11y/role-supports-aria-props': 'warn',
'jsx-a11y/scope': 'warn',
// https://github.com/gajus/eslint-plugin-flowtype
'flowtype/define-flow-type': 'warn',
'flowtype/require-valid-file-annotation': 'warn',
'flowtype/use-flow-type': 'warn',
// https://github.com/amilajack/eslint-plugin-compat
'compat/compat': 'warn',
// https://github.com/benmosher/eslint-plugin-import/tree/master/docs/rules
'import/prefer-default-export': 0,
// https://github.com/sindresorhus/eslint-plugin-unicorn#rules
'unicorn/filename-case': ['error', { case: 'kebabCase' }],
},
};
packages/eslint-config-react-app/package.json
+ 16
- 10
  • View file @ 6b8314d9

{
"name": "eslint-config-react-app",
"version": "2.0.1",
"name": "@stinkstudios/eslint-config-react-app",
"version": "0.3.4",
"description": "ESLint configuration used by Create React App",
"repository": "facebookincubator/create-react-app",
"repository": "stinkstudios/create-react-app",
"license": "MIT",
"bugs": {
"url": "https://github.com/facebookincubator/create-react-app/issues"
"url": "https://github.com/stinkstudios/create-react-app/issues"
},
"files": [
"index.js"
],
"peerDependencies": {
"babel-eslint": "^7.2.3",
"eslint": "^4.1.1",
"eslint-plugin-flowtype": "^2.34.1",
"eslint-plugin-import": "^2.6.0",
"eslint-plugin-jsx-a11y": "^5.1.1",
"eslint-plugin-react": "^7.1.0"
"babel-eslint": "^8.0.2",
"eslint": "^4.11.0",
"eslint-plugin-compat": "^2.1.0",
"eslint-plugin-flowtype": "^2.39.1",
"eslint-plugin-import": "^2.8.0",
"eslint-plugin-jsx-a11y": "^6.0.2",
"eslint-plugin-react": "^7.5.1",
"eslint-plugin-unicorn": "^3.0.1"
},
"dependencies": {
"eslint-config-airbnb": "^16.1.0",
"eslint-config-prettier": "^2.8.0"
}
}
packages/react-dev-utils/__tests__/.eslintrc deleted 100644 → 0
+ 0
- 5
  • View file @ 4bec8771

{
"env": {
"jest": true
}
}
packages/react-dev-utils/__tests__/ignoredFiles.test.js deleted 100644 → 0
+ 0
- 55
  • View file @ 4bec8771

/**
* Copyright (c) 2015-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
'use strict';
const ignoredFiles = require('../ignoredFiles');
describe('ignore watch files regex', () => {
it('normal file', () => {
const appSrc = '/root/src/';
const isIgnored = ignoredFiles(appSrc).test('/foo');
const isIgnoredInSrc = ignoredFiles(appSrc).test('/root/src/foo');
expect(isIgnored).toBe(false);
expect(isIgnoredInSrc).toBe(false);
});
it('node modules', () => {
const appSrc = '/root/src/';
const isIgnored = ignoredFiles(appSrc).test('/root/node_modules/foo');
expect(isIgnored).toBe(true);
});
it('node modules inside source directory', () => {
const appSrc = '/root/src/';
const isIgnored = ignoredFiles(appSrc).test('/root/src/node_modules/foo');
const isIgnoredMoreThanOneLevel = ignoredFiles(appSrc).test(
'/root/src/bar/node_modules/foo'
);
expect(isIgnored).toBe(false);
expect(isIgnoredMoreThanOneLevel).toBe(false);
});
it('path contains source directory', () => {
const appSrc = '/root/src/';
const isIgnored = ignoredFiles(appSrc).test(
'/bar/root/src/node_modules/foo'
);
expect(isIgnored).toBe(true);
});
it('path starts with source directory', () => {
const appSrc = '/root/src/';
const isIgnored = ignoredFiles(appSrc).test('/root/src2/node_modules/foo');
expect(isIgnored).toBe(true);
});
});
packages/react-dev-utils/FileSizeReporter.js deleted 100644 → 0
+ 0
- 141
  • View file @ 4bec8771

/**
* Copyright (c) 2015-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
'use strict';
var fs = require('fs');
var path = require('path');
var chalk = require('chalk');
var filesize = require('filesize');
var recursive = require('recursive-readdir');
var stripAnsi = require('strip-ansi');
var gzipSize = require('gzip-size').sync;
// Prints a detailed summary of build files.
function printFileSizesAfterBuild(
webpackStats,
previousSizeMap,
buildFolder,
maxBundleGzipSize,
maxChunkGzipSize
) {
var root = previousSizeMap.root;
var sizes = previousSizeMap.sizes;
var assets = webpackStats
.toJson()
.assets.filter(asset => /\.(js|css)$/.test(asset.name))
.map(asset => {
var fileContents = fs.readFileSync(path.join(root, asset.name));
var size = gzipSize(fileContents);
var previousSize = sizes[removeFileNameHash(root, asset.name)];
var difference = getDifferenceLabel(size, previousSize);
return {
folder: path.join(path.basename(buildFolder), path.dirname(asset.name)),
name: path.basename(asset.name),
size: size,
sizeLabel: filesize(size) + (difference ? ' (' + difference + ')' : ''),
};
});
assets.sort((a, b) => b.size - a.size);
var longestSizeLabelLength = Math.max.apply(
null,
assets.map(a => stripAnsi(a.sizeLabel).length)
);
var suggestBundleSplitting = false;
assets.forEach(asset => {
var sizeLabel = asset.sizeLabel;
var sizeLength = stripAnsi(sizeLabel).length;
if (sizeLength < longestSizeLabelLength) {
var rightPadding = ' '.repeat(longestSizeLabelLength - sizeLength);
sizeLabel += rightPadding;
}
var isMainBundle = asset.name.indexOf('main.') === 0;
var maxRecommendedSize = isMainBundle
? maxBundleGzipSize
: maxChunkGzipSize;
var isLarge = maxRecommendedSize && asset.size > maxRecommendedSize;
if (isLarge && path.extname(asset.name) === '.js') {
suggestBundleSplitting = true;
}
console.log(
' ' +
(isLarge ? chalk.yellow(sizeLabel) : sizeLabel) +
' ' +
chalk.dim(asset.folder + path.sep) +
chalk.cyan(asset.name)
);
});
if (suggestBundleSplitting) {
console.log();
console.log(
chalk.yellow('The bundle size is significantly larger than recommended.')
);
console.log(
chalk.yellow(
'Consider reducing it with code splitting: https://goo.gl/9VhYWB'
)
);
console.log(
chalk.yellow(
'You can also analyze the project dependencies: https://goo.gl/LeUzfb'
)
);
}
}
function removeFileNameHash(buildFolder, fileName) {
return fileName
.replace(buildFolder, '')
.replace(
/\/?(.*)(\.[0-9a-f]+)(\.chunk)?(\.js|\.css)/,
(match, p1, p2, p3, p4) => p1 + p4
);
}
// Input: 1024, 2048
// Output: "(+1 KB)"
function getDifferenceLabel(currentSize, previousSize) {
var FIFTY_KILOBYTES = 1024 * 50;
var difference = currentSize - previousSize;
var fileSize = !Number.isNaN(difference) ? filesize(difference) : 0;
if (difference >= FIFTY_KILOBYTES) {
return chalk.red('+' + fileSize);
} else if (difference < FIFTY_KILOBYTES && difference > 0) {
return chalk.yellow('+' + fileSize);
} else if (difference < 0) {
return chalk.green(fileSize);
} else {
return '';
}
}
function measureFileSizesBeforeBuild(buildFolder) {
return new Promise(resolve => {
recursive(buildFolder, (err, fileNames) => {
var sizes;
if (!err && fileNames) {
sizes = fileNames
.filter(fileName => /\.(js|css)$/.test(fileName))
.reduce((memo, fileName) => {
var contents = fs.readFileSync(fileName);
var key = removeFileNameHash(buildFolder, fileName);
memo[key] = gzipSize(contents);
return memo;
}, {});
}
resolve({
root: buildFolder,
sizes: sizes || {},
});
});
});
}
module.exports = {
measureFileSizesBeforeBuild: measureFileSizesBeforeBuild,
printFileSizesAfterBuild: printFileSizesAfterBuild,
};
packages/react-dev-utils/InterpolateHtmlPlugin.js deleted 100644 → 0
+ 0
- 44
  • View file @ 4bec8771

/**
* Copyright (c) 2015-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
// This Webpack plugin lets us interpolate custom variables into `index.html`.
// Usage: `new InterpolateHtmlPlugin({ 'MY_VARIABLE': 42 })`
// Then, you can use %MY_VARIABLE% in your `index.html`.
// It works in tandem with HtmlWebpackPlugin.
// Learn more about creating plugins like this:
// https://github.com/ampedandwired/html-webpack-plugin#events
'use strict';
const escapeStringRegexp = require('escape-string-regexp');
class InterpolateHtmlPlugin {
constructor(replacements) {
this.replacements = replacements;
}
apply(compiler) {
compiler.plugin('compilation', compilation => {
compilation.plugin(
'html-webpack-plugin-before-html-processing',
(data, callback) => {
// Run HTML through a series of user-specified string replacements.
Object.keys(this.replacements).forEach(key => {
const value = this.replacements[key];
data.html = data.html.replace(
new RegExp('%' + escapeStringRegexp(key) + '%', 'g'),
value
);
});
callback(null, data);
}
);
});
}
}
module.exports = InterpolateHtmlPlugin;
packages/react-dev-utils/ModuleScopePlugin.js deleted 100644 → 0
+ 0
- 81
  • View file @ 4bec8771

/**
* Copyright (c) 2015-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
'use strict';
const chalk = require('chalk');
const path = require('path');
class ModuleScopePlugin {
constructor(appSrc, allowedFiles = []) {
this.appSrc = appSrc;
this.allowedFiles = new Set(allowedFiles);
}
apply(resolver) {
const { appSrc } = this;
resolver.plugin('file', (request, callback) => {
// Unknown issuer, probably webpack internals
if (!request.context.issuer) {
return callback();
}
if (
// If this resolves to a node_module, we don't care what happens next
request.descriptionFileRoot.indexOf('/node_modules/') !== -1 ||
request.descriptionFileRoot.indexOf('\\node_modules\\') !== -1 ||
// Make sure this request was manual
!request.__innerRequest_request
) {
return callback();
}
// Resolve the issuer from our appSrc and make sure it's one of our files
// Maybe an indexOf === 0 would be better?
const relative = path.relative(appSrc, request.context.issuer);
// If it's not in src/ or a subdirectory, not our request!
if (relative.startsWith('../') || relative.startsWith('..\\')) {
return callback();
}
const requestFullPath = path.resolve(
path.dirname(request.context.issuer),
request.__innerRequest_request
);
if (this.allowedFiles.has(requestFullPath)) {
return callback();
}
// Find path from src to the requested file
// Error if in a parent directory of src/
const requestRelative = path.relative(appSrc, requestFullPath);
if (
requestRelative.startsWith('../') ||
requestRelative.startsWith('..\\')
) {
callback(
new Error(
`You attempted to import ${chalk.cyan(
request.__innerRequest_request
)} which falls outside of the project ${chalk.cyan(
'src/'
)} directory. ` +
`Relative imports outside of ${chalk.cyan(
'src/'
)} are not supported. ` +
`You can either move it inside ${chalk.cyan(
'src/'
)}, or add a symlink to it from project's ${chalk.cyan(
'node_modules/'
)}.`
),
request
);
} else {
callback();
}
});
}
}
module.exports = ModuleScopePlugin;
0 Assignees
None
Assign to
0 Reviewers
None
Request review from
Labels
1
CLA Signed
1
CLA Signed
    Assign labels
  • Manage project labels

Milestone
No milestone
None
None
Time tracking
No estimate or time spent
Lock merge request
Unlocked
1
1 participant
Administrator
Reference: facebook/create-react-app!3828
Source branch: github/fork/Stinkstudios/release

Menu

Explore Projects Groups Snippets