Skip to content

Commit d962cb3

Browse files
committed
Auto-fixes
1 parent e792de0 commit d962cb3

25 files changed

+17
-36
lines changed

node_package/src/ReactOnRails.client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ ctx.ReactOnRails = {
339339
},
340340

341341
resetOptions(): void {
342-
this.options = Object.assign({}, DEFAULT_OPTIONS);
342+
this.options = { ...DEFAULT_OPTIONS };
343343
},
344344
};
345345

node_package/src/clientStartup.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export async function clientStartup(context: Context): Promise<void> {
3131
return;
3232
}
3333

34-
// eslint-disable-next-line no-underscore-dangle, no-param-reassign
34+
// eslint-disable-next-line no-underscore-dangle
3535
context.__REACT_ON_RAILS_EVENT_HANDLERS_RAN_ONCE__ = true;
3636

3737
// force loaded components and stores are rendered and hydrated immediately

node_package/src/createReactOutput.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
/* eslint-disable react/prop-types */
2-
31
import * as React from 'react';
42
import type {
53
ServerRenderResult,

node_package/src/reactHydrateOrRender.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ if (supportsRootApi) {
1414
// https://github.com/webpack/webpack/issues/339#issuecomment-47739112
1515
// Unfortunately, it only converts the error to a warning.
1616
try {
17-
// eslint-disable-next-line global-require,import/no-unresolved
17+
// eslint-disable-next-line global-require
1818
reactDomClient = require('react-dom/client');
1919
} catch (e) {
2020
// We should never get here, but if we do, we'll just use the default ReactDOM

node_package/src/types/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// eslint-disable-next-line spaced-comment
21
/// <reference types="react/experimental" />
32

43
import type { ReactElement, ReactNode, Component, ComponentType } from 'react';

node_package/tests/ComponentRegistry.test.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
/* eslint-disable react/no-multi-comp */
21
/* eslint-disable react/prefer-es6-class */
32
/* eslint-disable react/prefer-stateless-function */
43
/* eslint-disable react/jsx-filename-extension */
54
/* eslint-disable no-unused-vars */
6-
/* eslint-disable import/extensions */
75

86
import * as React from 'react';
97
import * as createReactClass from 'create-react-class';

node_package/tests/RSCClientRoot.test.jsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
/* eslint-disable no-underscore-dangle */
2-
/* eslint-disable import/first */
32

43
// Mock webpack require system for RSC
54
window.__webpack_require__ = jest.fn();

node_package/tests/ReactOnRails.test.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable react/no-multi-comp */
21
/* eslint-disable react/prefer-es6-class */
32
/* eslint-disable react/prefer-stateless-function */
43
/* eslint-disable react/jsx-filename-extension */

node_package/tests/renderFunction.test.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable react/no-multi-comp */
21
/* eslint-disable react/prefer-es6-class */
32
/* eslint-disable react/prefer-stateless-function */
43
/* eslint-disable react/jsx-filename-extension */
@@ -63,9 +62,7 @@ describe('isRenderFunction', () => {
6362
it('returns false for a stateless functional component with one param', () => {
6463
expect.assertions(1);
6564

66-
/* eslint-disable react/prop-types */
6765
const pureComponent = (props) => <h1>{props.title}</h1>;
68-
/* eslint-enable react/prop-types */
6966

7067
expect(isRenderFunction(pureComponent)).toBe(false);
7168
});

spec/dummy/client/app/components/HelloWorldRedux.jsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ export default class HelloWorldRedux extends React.Component {
3333
// If this creates an alert, we have a problem!
3434
// see file node_package/src/scriptSanitizedVal.js for the fix to this prior issue.
3535

36-
/* eslint-disable no-console */
3736
console.log('This is a script:"</div>"</script> <script>alert(\'WTF1\')</script>');
3837
console.log('Script2:"</div>"</script xx> <script>alert(\'WTF2\')</script xx>');
3938
console.log('Script3:"</div>"</ SCRIPT xx> <script>alert(\'WTF3\')</script xx>');

0 commit comments

Comments
 (0)