diff --git a/.eslintignore b/.eslintignore
index 4024c90ff4..efe4328f1a 100644
--- a/.eslintignore
+++ b/.eslintignore
@@ -39,3 +39,5 @@ npm/webpack-preprocessor/examples/use-babelrc/cypress/integration/spec.js
**/.history
**/.cy
**/.git
+
+/npm/react/bin/*
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
index 44e4be97e0..d63d404853 100644
--- a/.gitignore
+++ b/.gitignore
@@ -323,4 +323,5 @@ $RECYCLE.BIN/
# Windows shortcuts
*.lnk
+/npm/react/bin/*
# End of https://www.gitignore.io/api/osx,git,node,windows,intellij,linux
diff --git a/npm/react/.eslintrc b/npm/react/.eslintrc
new file mode 100644
index 0000000000..e894c4b3e8
--- /dev/null
+++ b/npm/react/.eslintrc
@@ -0,0 +1,43 @@
+{
+ "plugins": [
+ "cypress",
+ "@cypress/dev"
+ ],
+ "extends": [
+ "plugin:@cypress/dev/general",
+ "plugin:@cypress/dev/tests",
+ "plugin:@cypress/dev/react"
+ ],
+ "parser": "@typescript-eslint/parser",
+ "env": {
+ "cypress/globals": true
+ },
+ "globals": {
+ "jest": "readonly"
+ },
+ "rules": {
+ "no-console": "off",
+ "mocha/no-global-tests": "off",
+ "@typescript-eslint/no-unused-vars": "off",
+ "react/jsx-filename-extension": [
+ "warn",
+ {
+ "extensions": [
+ ".js",
+ ".jsx",
+ ".tsx"
+ ]
+ }
+ ]
+ },
+ "overrides": [
+ {
+ "files": [
+ "lib/*"
+ ],
+ "rules": {
+ "no-console": 1
+ }
+ }
+ ]
+}
diff --git a/npm/react/cypress.json b/npm/react/cypress.json
index 5aa67bcc8e..85dbf55315 100644
--- a/npm/react/cypress.json
+++ b/npm/react/cypress.json
@@ -13,7 +13,10 @@
"root": "#cypress-root"
}
},
- "ignoreTestFiles": ["**/__snapshots__/*", "**/__image_snapshots__/*"],
+ "ignoreTestFiles": [
+ "**/__snapshots__/*",
+ "**/__image_snapshots__/*"
+ ],
"experimentalComponentTesting": true,
"experimentalFetchPolyfill": true
}
diff --git a/npm/react/cypress/component/advanced/api-test/spec.js b/npm/react/cypress/component/advanced/api-test/spec.js
index ff9c71b3b3..becd3d64ef 100644
--- a/npm/react/cypress/component/advanced/api-test/spec.js
+++ b/npm/react/cypress/component/advanced/api-test/spec.js
@@ -21,18 +21,19 @@ describe('Component and API tests', () => {
// same or similar URL to the one the component is using
url: 'https://jsonplaceholder.cypress.io/users?_limit=3',
})
- .its('body')
- .should('have.length', 3)
+ .its('body')
+ .should('have.length', 3)
})
// another component test
it('shows stubbed users', () => {
cy.stub(window, 'fetch').resolves({
json: cy
- .stub()
- .resolves([{ id: 101, name: 'Test User' }])
- .as('users'),
+ .stub()
+ .resolves([{ id: 101, name: 'Test User' }])
+ .as('users'),
})
+
// no mocking, just real request to the backend REST endpoint
mount(
count: {this.state.count}
} } diff --git a/npm/react/cypress/component/advanced/context/App.jsx b/npm/react/cypress/component/advanced/context/App.jsx index 4ae17b557c..4620e6c388 100644 --- a/npm/react/cypress/component/advanced/context/App.jsx +++ b/npm/react/cypress/component/advanced/context/App.jsx @@ -3,7 +3,7 @@ import { ThemeContext } from './context' import { Toolbar } from './Toolbar.jsx' export default class App extends React.Component { - render() { + render () { // Use a Provider to pass the current theme to the tree below. // Any component can read it, no matter how deep it is. // In this example, we're passing "dark" as the current value. diff --git a/npm/react/cypress/component/advanced/context/Mock-context-spec.js b/npm/react/cypress/component/advanced/context/Mock-context-spec.js index 188483b54b..9a8a19e5f9 100644 --- a/npm/react/cypress/component/advanced/context/Mock-context-spec.js +++ b/npm/react/cypress/component/advanced/context/Mock-context-spec.js @@ -10,6 +10,7 @@ describe('Mocking context', () => {