@@ -109,10 +109,7 @@ public function downloadScaffold() {
109109 $ dispatcher = new EventDispatcher ($ this ->composer , $ this ->io );
110110 $ dispatcher ->dispatch (self ::PRE_DRUPAL_SCAFFOLD_CMD );
111111
112- $ version = $ drupalCorePackage ->getPrettyVersion ();
113- if ($ drupalCorePackage ->getStability () == 'dev ' && substr ($ version , -4 ) == '-dev ' ) {
114- $ version = substr ($ version , 0 , -4 );
115- }
112+ $ version = $ this ->getDrupalCoreVersion ($ drupalCorePackage );
116113
117114 $ remoteFs = new RemoteFilesystem ($ this ->io );
118115
@@ -200,6 +197,22 @@ public function getDrupalCorePackage() {
200197 return $ this ->drupalCorePackage ;
201198 }
202199
200+ /**
201+ * Returns the Drupal core version for the given package.
202+ *
203+ * @param \Composer\Package\PackageInterface $drupalCorePackage
204+ *
205+ * @return string
206+ */
207+ protected function getDrupalCoreVersion (PackageInterface $ drupalCorePackage ) {
208+ $ version = $ drupalCorePackage ->getPrettyVersion ();
209+ if ($ drupalCorePackage ->getStability () == 'dev ' && substr ($ version , -4 ) == '-dev ' ) {
210+ $ version = substr ($ version , 0 , -4 );
211+ return $ version ;
212+ }
213+ return $ version ;
214+ }
215+
203216 /**
204217 * Retrieve the path to the web root.
205218 *
@@ -301,11 +314,20 @@ protected function getExcludesDefault() {
301314 * Holds default settings files list.
302315 */
303316 protected function getIncludesDefault () {
304- return [
317+ $ version = $ this ->getDrupalCoreVersion ($ this ->getDrupalCorePackage ());
318+ list ($ major , $ minor ) = explode ('. ' , $ version , 3 );
319+ $ version = "$ major. $ minor " ;
320+
321+ /**
322+ * Files from 8.3.x
323+ *
324+ * @see http://cgit.drupalcode.org/drupal/tree/?h=8.3.x
325+ */
326+ $ common = [
305327 '.csslintrc ' ,
306328 '.editorconfig ' ,
307329 '.eslintignore ' ,
308- '.eslintrc ' ,
330+ '.eslintrc.json ' ,
309331 '.gitattributes ' ,
310332 '.htaccess ' ,
311333 'index.php ' ,
@@ -318,6 +340,19 @@ protected function getIncludesDefault() {
318340 'update.php ' ,
319341 'web.config '
320342 ];
343+
344+ // Version specific variations.
345+ switch ($ version ) {
346+ case '8.0 ' :
347+ case '8.1 ' :
348+ case '8.2 ' :
349+ $ common [] = '.eslintrc ' ;
350+ $ common = array_diff ($ common , ['.eslintrc.json ' ]);
351+ break ;
352+ }
353+
354+ sort ($ common );
355+ return $ common ;
321356 }
322357
323358 /**
0 commit comments