فهرست منبع

meta: remove CJS-related hack in `build:locale-pack` script (#3764)

Antoine du Hamel 2 سال پیش
والد
کامیت
f10745ec27

+ 1 - 8
private/locale-pack/index.mjs

@@ -93,18 +93,11 @@ async function generateLocaleDocs (pluginName) {
       // Replace all nodes after the locale heading until the next heading (or eof)
       headingRange(tree, rangeOptions, (start, _, end) => [
         start,
-        {
-          type: 'html',
-          // `module.exports` is not allowed by eslint in our docs.
-          // The script outputs an extra newline which also isn't excepted by eslint
-          // TODO: remove the no-restricted-globals when switch to ESM is completed.
-          value: '<!-- eslint-disable no-restricted-globals, no-multiple-empty-lines -->',
-        },
         {
           type: 'code',
           lang: 'js',
           meta: null,
-          value: fs.readFileSync(localePath, 'utf-8'),
+          value: fs.readFileSync(localePath, 'utf-8').trimEnd(),
         },
         end,
       ])

+ 0 - 3
website/src/docs/audio.md

@@ -65,8 +65,6 @@ Configures whether to show a dropdown which enables to choose the audio device t
 
 ### `locale: {}`
 
-<!-- eslint-disable no-restricted-globals, no-multiple-empty-lines -->
-
 ```js
 export default {
   strings: {
@@ -98,5 +96,4 @@ export default {
     discardRecordedFile: 'Discard recorded file',
   },
 }
-
 ```

+ 0 - 3
website/src/docs/aws-s3.md

@@ -115,15 +115,12 @@ This option is useful when uploading to an S3-like service that doesn’t reply
 
 ### `locale: {}`
 
-<!-- eslint-disable no-restricted-globals, no-multiple-empty-lines -->
-
 ```js
 export default  {
   strings: {
     timedOut: 'Upload stalled for %{seconds} seconds, aborting.',
   },
 }
-
 ```
 
 ## S3 Bucket configuration

+ 0 - 3
website/src/docs/box.md

@@ -127,13 +127,10 @@ This option correlates to the [RequestCredentials value](https://developer.mozil
 
 ### `locale: {}`
 
-<!-- eslint-disable no-restricted-globals, no-multiple-empty-lines -->
-
 ```js
 export default {
   strings: {
     pluginNameBox: 'Box',
   },
 }
-
 ```

+ 0 - 3
website/src/docs/core.md

@@ -277,8 +277,6 @@ const uppy = new Uppy({
 
 ### `locale: {}`
 
-<!-- eslint-disable no-restricted-globals, no-multiple-empty-lines -->
-
 ```js
 export default {
   strings: {
@@ -338,7 +336,6 @@ export default {
     },
   },
 }
-
 ```
 
 ### `store: defaultStore()`

+ 0 - 3
website/src/docs/dashboard.md

@@ -334,8 +334,6 @@ Dashboard ships with the `ThumbnailGenerator` plugin that adds small resized ima
 
 ### `locale: {}`
 
-<!-- eslint-disable no-restricted-globals, no-multiple-empty-lines -->
-
 ```js
 export default {
   strings: {
@@ -425,7 +423,6 @@ export default {
     },
   },
 }
-
 ```
 
 ### `theme: 'light'`

+ 0 - 3
website/src/docs/drag-drop.md

@@ -86,8 +86,6 @@ Optionally, specify a string of text that explains something about the upload fo
 
 ### `locale: {}`
 
-<!-- eslint-disable no-restricted-globals, no-multiple-empty-lines -->
-
 ```js
 export default {
   strings: {
@@ -98,7 +96,6 @@ export default {
     browse: 'browse',
   },
 }
-
 ```
 
 ### `onDragOver(event)`

+ 0 - 3
website/src/docs/dropbox.md

@@ -127,13 +127,10 @@ This option correlates to the [RequestCredentials value](https://developer.mozil
 
 ### `locale: {}`
 
-<!-- eslint-disable no-restricted-globals, no-multiple-empty-lines -->
-
 ```js
 export default {
   strings: {
     pluginNameDropbox: 'Dropbox',
   },
 }
-
 ```

+ 0 - 3
website/src/docs/facebook.md

@@ -86,13 +86,10 @@ This option correlates to the [RequestCredentials value](https://developer.mozil
 
 ### `locale: {}`
 
-<!-- eslint-disable no-restricted-globals, no-multiple-empty-lines -->
-
 ```js
 export default {
   strings: {
     pluginNameFacebook: 'Facebook',
   },
 }
-
 ```

+ 0 - 3
website/src/docs/file-input.md

@@ -84,8 +84,6 @@ The `name` attribute for the `<input type="file">` element.
 
 ### `locale: {}`
 
-<!-- eslint-disable no-restricted-globals, no-multiple-empty-lines -->
-
 ```js
 export default {
   strings: {
@@ -95,7 +93,6 @@ export default {
     chooseFiles: 'Choose files',
   },
 }
-
 ```
 
 ## Custom file input

+ 0 - 3
website/src/docs/google-drive.md

@@ -122,13 +122,10 @@ This option correlates to the [RequestCredentials value](https://developer.mozil
 
 ### `locale: {}`
 
-<!-- eslint-disable no-restricted-globals, no-multiple-empty-lines -->
-
 ```js
 export default {
   strings: {
     pluginNameGoogleDrive: 'Google Drive',
   },
 }
-
 ```

+ 0 - 3
website/src/docs/image-editor.md

@@ -123,8 +123,6 @@ uppy.on('file-editor:complete', (updatedFile) => {
 
 ### `locale: {}`
 
-<!-- eslint-disable no-restricted-globals, no-multiple-empty-lines -->
-
 ```js
 export default {
   strings: {
@@ -138,5 +136,4 @@ export default {
     aspectRatioPortrait: 'Crop portrait (9:16)',
   },
 }
-
 ```

+ 0 - 3
website/src/docs/instagram.md

@@ -92,13 +92,10 @@ This option correlates to the [RequestCredentials value](https://developer.mozil
 
 ### `locale: {}`
 
-<!-- eslint-disable no-restricted-globals, no-multiple-empty-lines -->
-
 ```js
 export default {
   strings: {
     pluginNameInstagram: 'Instagram',
   },
 }
-
 ```

+ 0 - 3
website/src/docs/onedrive.md

@@ -86,13 +86,10 @@ This option correlates to the [RequestCredentials value](https://developer.mozil
 
 ### `locale: {}`
 
-<!-- eslint-disable no-restricted-globals, no-multiple-empty-lines -->
-
 ```js
 export default {
   strings: {
     pluginNameOneDrive: 'OneDrive',
   },
 }
-
 ```

+ 0 - 3
website/src/docs/screen-capture.md

@@ -102,8 +102,6 @@ If no preferred video mime type is given, the ScreenCapture plugin will prefer t
 
 ### `locale: {}`
 
-<!-- eslint-disable no-restricted-globals, no-multiple-empty-lines -->
-
 ```js
 export default {
   strings: {
@@ -116,5 +114,4 @@ export default {
     recording: 'Recording',
   },
 }
-
 ```

+ 0 - 3
website/src/docs/status-bar.md

@@ -120,8 +120,6 @@ const doneButtonHandler = () => {
 
 ### `locale: {}`
 
-<!-- eslint-disable no-restricted-globals, no-multiple-empty-lines -->
-
 ```js
 export default {
   strings: {
@@ -172,7 +170,6 @@ export default {
     showErrorDetails: 'Show error details',
   },
 }
-
 ```
 
 [`@uppy/file-input`]: /docs/file-input

+ 0 - 3
website/src/docs/thumbnail-generator.md

@@ -60,15 +60,12 @@ A unique identifier for this plugin. It defaults to `'ThumbnailGenerator'`.
 
 ### `locale: {}`
 
-<!-- eslint-disable no-restricted-globals, no-multiple-empty-lines -->
-
 ```js
 export default {
   strings: {
     generatingThumbnails: 'Generating thumbnails...',
   },
 }
-
 ```
 
 ### `thumbnailWidth: 200`

+ 0 - 3
website/src/docs/transloadit.md

@@ -302,8 +302,6 @@ Limit the amount of uploads going on at the same time. Setting this to `0` means
 
 ### `locale: {}`
 
-<!-- eslint-disable no-restricted-globals, no-multiple-empty-lines -->
-
 ```js
 export default {
   strings: {
@@ -316,7 +314,6 @@ export default {
     encoding: 'Encoding...',
   },
 }
-
 ```
 
 ## Errors

+ 0 - 3
website/src/docs/url.md

@@ -84,8 +84,6 @@ This option correlates to the [RequestCredentials value](https://developer.mozil
 
 ### `locale: {}`
 
-<!-- eslint-disable no-restricted-globals, no-multiple-empty-lines -->
-
 ```js
 export default {
   strings: {
@@ -99,7 +97,6 @@ export default {
     enterCorrectUrl: 'Incorrect URL: Please make sure you are entering a direct link to a file',
   },
 }
-
 ```
 
 ## Methods

+ 0 - 3
website/src/docs/webcam.md

@@ -158,8 +158,6 @@ If no preferred image mime type is given, the Webcam plugin will prefer types li
 
 ### `locale: {}`
 
-<!-- eslint-disable no-restricted-globals, no-multiple-empty-lines -->
-
 ```js
 export default {
   strings: {
@@ -189,5 +187,4 @@ export default {
     allowAccessDescription: 'In order to take pictures or record video with your camera, please allow camera access for this site.',
   },
 }
-
 ```

+ 0 - 3
website/src/docs/xhr-upload.md

@@ -231,8 +231,6 @@ Indicates whether cross-site Access-Control requests should be made using creden
 
 ### `locale: {}`
 
-<!-- eslint-disable no-restricted-globals, no-multiple-empty-lines -->
-
 ```js
 export default {
   strings: {
@@ -240,7 +238,6 @@ export default {
     timedOut: 'Upload stalled for %{seconds} seconds, aborting.',
   },
 }
-
 ```
 
 ## POST Parameters / Form Fields

+ 0 - 3
website/src/docs/zoom.md

@@ -90,15 +90,12 @@ This option correlates to the [RequestCredentials value](https://developer.mozil
 
 ### `locale: {}`
 
-<!-- eslint-disable no-restricted-globals, no-multiple-empty-lines -->
-
 ```js
 export default {
   strings: {
     pluginNameZoom: 'Zoom',
   },
 }
-
 ```
 
 ## Zoom Marketplace