Skip to content

Commit 8d8b494

Browse files
committed
Fix stylelint config
1 parent 4522aa7 commit 8d8b494

File tree

1 file changed

+26
-24
lines changed

1 file changed

+26
-24
lines changed

packages/react-scripts/scripts/eject.js

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,19 @@ prompt(
5656
const folders = ['config', 'config/jest', 'scripts', 'scripts/utils'];
5757

5858
// Make shallow array of files paths
59-
const files = folders.reduce((files, folder) => {
60-
return files.concat(
61-
fs
62-
.readdirSync(path.join(ownPath, folder))
63-
// set full path
64-
.map(file => path.join(ownPath, folder, file))
65-
// omit dirs from file list
66-
.filter(file => fs.lstatSync(file).isFile())
67-
);
68-
}, []);
59+
const files = folders.reduce(
60+
(files, folder) => {
61+
return files.concat(
62+
fs
63+
.readdirSync(path.join(ownPath, folder))
64+
// set full path
65+
.map(file => path.join(ownPath, folder, file))
66+
// omit dirs from file list
67+
.filter(file => fs.lstatSync(file).isFile())
68+
);
69+
},
70+
[]
71+
);
6972

7073
// Ensure that the app folder is clean and we won't override any files
7174
folders.forEach(verifyAbsent);
@@ -85,19 +88,18 @@ prompt(
8588
if (content.match(/\/\/ @remove-file-on-eject/)) {
8689
return;
8790
}
88-
content =
89-
content
90-
// Remove dead code from .js files on eject
91-
.replace(
92-
/\/\/ @remove-on-eject-begin([\s\S]*?)\/\/ @remove-on-eject-end/gm,
93-
''
94-
)
95-
// Remove dead code from .applescript files on eject
96-
.replace(
97-
/-- @remove-on-eject-begin([\s\S]*?)-- @remove-on-eject-end/gm,
98-
''
99-
)
100-
.trim() + '\n';
91+
content = content
92+
// Remove dead code from .js files on eject
93+
.replace(
94+
/\/\/ @remove-on-eject-begin([\s\S]*?)\/\/ @remove-on-eject-end/gm,
95+
''
96+
)
97+
// Remove dead code from .applescript files on eject
98+
.replace(
99+
/-- @remove-on-eject-begin([\s\S]*?)-- @remove-on-eject-end/gm,
100+
''
101+
)
102+
.trim() + '\n';
101103
console.log(` Adding ${cyan(file.replace(ownPath, ''))} to the project`);
102104
fs.writeFileSync(file.replace(ownPath, appPath), content);
103105
});
@@ -166,7 +168,7 @@ prompt(
166168
// Add stylelint config
167169
console.log(` Adding ${cyan('stylelint')} configuration`);
168170
appPackage.stylelint = {
169-
extends: 'stylelint-config-standard',
171+
extends: 'stylelint-config-react-app',
170172
};
171173

172174
fs.writeFileSync(

0 commit comments

Comments
 (0)