Merge pull request #6722 from paulkaplan/eslint-update-scratch-6
This commit is contained in:
15 files changed
+35
-30
No files matched your search
Generated
+3
-3
@@ -6735,9 +6735,9 @@
|
||||
}
|
||||
},
|
||||
"eslint-config-scratch": {
|
||||
"version": "5.1.0",
|
||||
"resolved": "https://registry.npmjs.org/eslint-config-scratch/-/eslint-config-scratch-5.1.0.tgz",
|
||||
"integrity": "sha512-JQMxERL3eo0TMy87NZFm6yS0i2XOMplffKz9CD/2ta2i/+3FTgajxzF9n7R7vi9C+GMLSTSLZJ5X90tINuAhjg==",
|
||||
"version": "6.0.0",
|
||||
"resolved": "https://registry.npmjs.org/eslint-config-scratch/-/eslint-config-scratch-6.0.0.tgz",
|
||||
"integrity": "sha512-2aW7EVWhjTrwaM54hjAZeRETh/habWeQ5xzTbPO2dG//RtixBztUAmdxqAHKH8MEtmAMsUhf3mRjO1BstO4dGg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"eslint-plugin-react": ">=7.14.2"
|
||||
|
||||
+2
-2
@@ -106,8 +106,8 @@
|
||||
"chromedriver": "87.0.7",
|
||||
"enzyme": "^3.5.0",
|
||||
"enzyme-adapter-react-16": "1.3.0",
|
||||
"eslint": "^5.0.1",
|
||||
"eslint-config-scratch": "^5.0.0",
|
||||
"eslint": "^5.7.0",
|
||||
"eslint-config-scratch": "^6.0.0",
|
||||
"eslint-import-resolver-webpack": "^0.11.1",
|
||||
"eslint-plugin-import": "^2.18.2",
|
||||
"eslint-plugin-jest": "^22.14.1",
|
||||
|
||||
@@ -34,8 +34,8 @@ import {
|
||||
|
||||
const addFunctionListener = (object, property, callback) => {
|
||||
const oldFn = object[property];
|
||||
object[property] = function () {
|
||||
const result = oldFn.apply(this, arguments);
|
||||
object[property] = function (...args) {
|
||||
const result = oldFn.apply(this, args);
|
||||
callback.apply(this, result);
|
||||
return result;
|
||||
};
|
||||
|
||||
@@ -165,7 +165,7 @@ class SoundEditor extends React.Component {
|
||||
)
|
||||
.catch(e => {
|
||||
// Encoding failed, or the sound was too large to save so edit is rejected
|
||||
log.error(`Encountered error while trying to encode sound update: ${e}`);
|
||||
log.error(`Encountered error while trying to encode sound update: ${e.message}`);
|
||||
return false; // Edit was not applied
|
||||
});
|
||||
}
|
||||
@@ -349,7 +349,7 @@ class SoundEditor extends React.Component {
|
||||
if (newRate === buffer.sampleRate / 2) {
|
||||
return resolve(dropEveryOtherSample(buffer));
|
||||
}
|
||||
return reject('Could not resample');
|
||||
return reject(new Error('Could not resample'));
|
||||
}
|
||||
const source = offlineContext.createBufferSource();
|
||||
const audioBuffer = offlineContext.createBuffer(1, buffer.samples.length, buffer.sampleRate);
|
||||
|
||||
@@ -8,8 +8,7 @@ import {connect} from 'react-redux';
|
||||
import {STAGE_DISPLAY_SIZES} from '../lib/layout-constants';
|
||||
import {getEventXY} from '../lib/touch-utils';
|
||||
import VideoProvider from '../lib/video/video-provider';
|
||||
import {SVGRenderer as V2SVGAdapter} from 'scratch-svg-renderer';
|
||||
import {BitmapAdapter as V2BitmapAdapter} from 'scratch-svg-renderer';
|
||||
import {SVGRenderer as V2SVGAdapter, BitmapAdapter as V2BitmapAdapter} from 'scratch-svg-renderer';
|
||||
|
||||
import StageComponent from '../components/stage/stage.jsx';
|
||||
|
||||
|
||||
@@ -86,7 +86,7 @@ const downsampleIfNeeded = (buffer, resampler) => {
|
||||
}
|
||||
// Cannot save this sound at 22khz, refuse to edit
|
||||
// In the future we could introduce further compression here
|
||||
return Promise.reject('Sound too large to save, refusing to edit');
|
||||
return Promise.reject(new Error('Sound too large to save, refusing to edit'));
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -26,7 +26,7 @@ const getBackpackContents = ({
|
||||
json: true
|
||||
}, (error, response) => {
|
||||
if (error || response.statusCode !== 200) {
|
||||
return reject();
|
||||
return reject(new Error(response.status));
|
||||
}
|
||||
return resolve(response.body.map(item => includeFullUrls(item, host)));
|
||||
});
|
||||
@@ -49,7 +49,7 @@ const saveBackpackObject = ({
|
||||
json: {type, mime, name, body, thumbnail}
|
||||
}, (error, response) => {
|
||||
if (error || response.statusCode !== 200) {
|
||||
return reject();
|
||||
return reject(new Error(response.status));
|
||||
}
|
||||
return resolve(includeFullUrls(response.body, host));
|
||||
});
|
||||
@@ -67,7 +67,7 @@ const deleteBackpackObject = ({
|
||||
headers: {'x-token': token}
|
||||
}, (error, response) => {
|
||||
if (error || response.statusCode !== 200) {
|
||||
return reject();
|
||||
return reject(new Error(response.status));
|
||||
}
|
||||
return resolve(response.body);
|
||||
});
|
||||
@@ -78,7 +78,7 @@ const deleteBackpackObject = ({
|
||||
const fetchAs = (responseType, uri) => new Promise((resolve, reject) => {
|
||||
xhr({uri, responseType}, (error, response) => {
|
||||
if (error || response.statusCode !== 200) {
|
||||
return reject();
|
||||
return reject(new Error(response.status));
|
||||
}
|
||||
return resolve(response.body);
|
||||
});
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
module.exports = {
|
||||
rules: {
|
||||
// These manifest files use duplicate imports to make things easier to follow
|
||||
// by providing clear parallel structure. Turn the error off for this folder.
|
||||
'no-duplicate-imports': 0
|
||||
}
|
||||
};
|
||||
@@ -1,5 +1,4 @@
|
||||
import alertsData from '../lib/alerts/index.jsx';
|
||||
import {AlertTypes, AlertLevels} from '../lib/alerts/index.jsx';
|
||||
import alertsData, {AlertTypes, AlertLevels} from '../lib/alerts/index.jsx';
|
||||
import extensionData from '../lib/libraries/extensions/index.jsx';
|
||||
|
||||
const SHOW_ALERT = 'scratch-gui/alerts/SHOW_ALERT';
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import {addLocaleData} from 'react-intl';
|
||||
|
||||
import {localeData} from 'scratch-l10n';
|
||||
import {localeData, isRtl} from 'scratch-l10n';
|
||||
import editorMessages from 'scratch-l10n/locales/editor-msgs';
|
||||
import {isRtl} from 'scratch-l10n';
|
||||
|
||||
addLocaleData(localeData);
|
||||
|
||||
|
||||
@@ -16,7 +16,9 @@ const UNSUPPORTED_MESSAGE = 'Scratch 3.0 does not support Internet Explorer';
|
||||
describe('Smoke tests on older browsers', () => {
|
||||
let driver;
|
||||
|
||||
afterEach(async () => await (driver && driver.quit()));
|
||||
afterEach(async () => {
|
||||
if (driver) await driver.quit();
|
||||
});
|
||||
|
||||
test('Credentials should be provided', () => {
|
||||
expect(SAUCE_USERNAME && SAUCE_ACCESS_KEY && SMOKE_URL).toBeTruthy();
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
|
||||
/* eslint-env jest */
|
||||
import {AlertTypes, AlertLevels} from '../../../src/lib/alerts/index.jsx';
|
||||
import alertsReducer from '../../../src/reducers/alerts';
|
||||
import {
|
||||
import alertsReducer, {
|
||||
closeAlert,
|
||||
closeAlertWithId,
|
||||
filterInlineAlerts,
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
/* eslint-env jest */
|
||||
import monitorLayoutReducer from '../../../src/reducers/monitor-layout';
|
||||
import {addMonitorRect, moveMonitorRect} from '../../../src/reducers/monitor-layout';
|
||||
import {resizeMonitorRect, removeMonitorRect} from '../../../src/reducers/monitor-layout';
|
||||
import {getInitialPosition, PADDING, SCREEN_WIDTH, SCREEN_HEIGHT} from '../../../src/reducers/monitor-layout';
|
||||
import monitorLayoutReducer, {
|
||||
addMonitorRect, moveMonitorRect,
|
||||
resizeMonitorRect, removeMonitorRect,
|
||||
getInitialPosition, PADDING, SCREEN_WIDTH, SCREEN_HEIGHT
|
||||
} from '../../../src/reducers/monitor-layout';
|
||||
|
||||
test('initialState', () => {
|
||||
let defaultState;
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
/* eslint-env jest */
|
||||
import projectStateReducer from '../../../src/reducers/project-state';
|
||||
import {
|
||||
import projectStateReducer, {
|
||||
LoadingState,
|
||||
autoUpdateProject,
|
||||
doneCreatingProject,
|
||||
|
||||
@@ -76,7 +76,7 @@ describe('downsampleIfNeeded', () => {
|
||||
try {
|
||||
await downsampleIfNeeded({samples, sampleRate}, null);
|
||||
} catch (e) {
|
||||
expect(e).toEqual('Sound too large to save, refusing to edit');
|
||||
expect(e.message).toEqual('Sound too large to save, refusing to edit');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user