Ver código fonte

JS linting fixes

Thibaud Colas 7 anos atrás
pai
commit
f115ff7f4d

+ 4 - 4
client/src/components/Draftail/decorators/Document.test.js

@@ -8,7 +8,7 @@ describe('Document', () => {
   it('works', () => {
     const content = convertFromRaw({
       entityMap: {
-        '1': {
+        1: {
           type: 'DOCUMENT',
           data: {
             url: '/example.pdf',
@@ -29,7 +29,7 @@ describe('Document', () => {
           ]
         }
       ]
-    })
+    });
     expect(shallow((
       <Document
         contentState={content}
@@ -45,7 +45,7 @@ describe('Document', () => {
   it('no data', () => {
     const content = convertFromRaw({
       entityMap: {
-        '2': {
+        2: {
           type: 'DOCUMENT',
         }
       },
@@ -62,7 +62,7 @@ describe('Document', () => {
           ]
         }
       ]
-    })
+    });
     expect(shallow((
       <Document
         contentState={content}

+ 6 - 6
client/src/components/Draftail/decorators/Link.test.js

@@ -8,7 +8,7 @@ describe('Link', () => {
   it('works', () => {
     const content = convertFromRaw({
       entityMap: {
-        '1': {
+        1: {
           type: 'LINK',
           data: {
             url: 'http://www.example.com/',
@@ -28,7 +28,7 @@ describe('Link', () => {
           ]
         }
       ]
-    })
+    });
     expect(shallow((
       <Link
         contentState={content}
@@ -46,25 +46,25 @@ describe('Link', () => {
       expect(getLinkAttributes({ id: '1', url: '/' })).toMatchObject({
         url: '/',
         label: '/',
-      })
+      });
     });
 
     it('mail', () => {
       expect(getLinkAttributes({ url: 'mailto:test@ex.com' })).toMatchObject({
         url: 'mailto:test@ex.com',
         label: 'test@ex.com',
-      })
+      });
     });
 
     it('external', () => {
       expect(getLinkAttributes({ url: 'http://www.ex.com/' })).toMatchObject({
         url: 'http://www.ex.com/',
         label: 'www.ex.com',
-      })
+      });
     });
 
     it('no data', () => {
-      expect(getLinkAttributes({})).toMatchObject({ url: '' })
+      expect(getLinkAttributes({})).toMatchObject({ url: '' });
     });
   });
 });

+ 8 - 4
client/webpack/base.config.js

@@ -53,14 +53,18 @@ module.exports = function exports() {
           exclude: /node_modules/,
         },
       ].concat(Object.keys(exposedDependencies).map((name) => {
+        const globalName = exposedDependencies[name];
+
         // Create expose-loader configs for each Wagtail dependency.
         return {
           test: require.resolve(name),
-          use: [{
+          use: [
+            {
               loader: 'expose-loader',
-              options: exposedDependencies[name]
-          }]
-      }
+              options: globalName,
+            },
+          ],
+        };
       }))
     },
     stats: {