-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rework eslint config steal some from content-sources-frontend Add globals dep for eslint config Manual fixes for eslint9 Removed some JSX chunks with `false && <element>` syntax ignore cypress screenshots dir Update fileUpload and test In fileUpload, use a function prototype instead of null and just always call it. In the testcase, use cy.intercept since afterUpload won't get called when the POST fails because the backend isn't running
- Loading branch information
Showing
68 changed files
with
1,625 additions
and
1,513 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,4 +27,4 @@ repos: | |
- repo: https://github.com/AleksaC/hadolint-py | ||
rev: v2.12.1b3 | ||
hooks: | ||
- id: hadolint | ||
- id: hadolint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
v18 | ||
v20 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# test directories | ||
__tests__ | ||
test | ||
tests | ||
powered-test | ||
|
||
# asset directories | ||
docs | ||
doc | ||
website | ||
images | ||
#assets | ||
|
||
# examples | ||
example | ||
examples | ||
|
||
# code coverage directories | ||
coverage | ||
.nyc_output | ||
|
||
# build scripts | ||
Makefile | ||
Gulpfile.js | ||
Gruntfile.js | ||
|
||
# configs | ||
appveyor.yml | ||
circle.yml | ||
codeship-services.yml | ||
codeship-steps.yml | ||
wercker.yml | ||
.tern-project | ||
.gitattributes | ||
.editorconfig | ||
.*ignore | ||
.eslintrc | ||
.jshintrc | ||
.flowconfig | ||
.documentup.json | ||
.yarn-metadata.json | ||
.travis.yml | ||
|
||
# misc | ||
*.md |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
// eslint.config.mjs | ||
import cypress from 'eslint-plugin-cypress'; | ||
import react from 'eslint-plugin-react'; | ||
import prettier from 'eslint-plugin-prettier'; | ||
import unusedImports from 'eslint-plugin-unused-imports'; | ||
import { fileURLToPath } from 'node:url'; | ||
import globals from 'globals'; | ||
import path from 'node:path'; | ||
import js from '@eslint/js'; | ||
import { FlatCompat } from '@eslint/eslintrc'; | ||
import hooksPlugin from 'eslint-plugin-react-hooks'; | ||
import pkg from '@babel/eslint-parser'; | ||
|
||
const __filename = fileURLToPath(import.meta.url); | ||
const __dirname = path.dirname(__filename); | ||
const compat = new FlatCompat({ | ||
baseDirectory: __dirname, | ||
recommendedConfig: js.configs.recommended, | ||
allConfig: js.configs.all, | ||
}); | ||
|
||
export default [ | ||
{ | ||
files: ['src/*', 'cypress/*'], | ||
ignores: ['node_modules/*'], | ||
}, | ||
...compat.extends( | ||
'eslint:recommended', | ||
'plugin:react/recommended', | ||
'plugin:react-hooks/recommended', | ||
'plugin:cypress/recommended', | ||
'prettier', | ||
), | ||
{ | ||
plugins: { | ||
cypress, | ||
prettier, | ||
react, | ||
'unused-imports': unusedImports, | ||
'react-hooks': hooksPlugin, | ||
}, | ||
languageOptions: { | ||
globals: { | ||
...globals.browser, | ||
...globals.node, | ||
...globals.cypress, | ||
es202: true, | ||
}, | ||
parser: pkg, | ||
parserOptions: { | ||
ecmaVersion: 2020, | ||
sourceType: 'module', | ||
ecmaFeatures: { | ||
jsx: true, | ||
}, | ||
requireConfigFile: false, | ||
plugins: [ | ||
'@babel/plugin-transform-class-properties', | ||
'@babel/plugin-transform-private-methods', | ||
'@babel/plugin-syntax-jsx', | ||
'@babel/plugin-syntax-flow' | ||
], | ||
babelOptions: { | ||
presets: [ | ||
'@babel/preset-flow', | ||
'@babel/preset-env', | ||
'@babel/preset-react', | ||
] | ||
}, | ||
}, | ||
}, | ||
rules: { | ||
'cypress/no-assigning-return-values': 'error', | ||
'cypress/no-unnecessary-waiting': 'error', | ||
'cypress/assertion-before-screenshot': 'warn', | ||
'cypress/no-force': 'warn', | ||
'cypress/no-async-tests': 'error', | ||
'cypress/no-async-before': 'error', | ||
'cypress/no-pause': 'error', | ||
'react/jsx-curly-brace-presence': [ | ||
'error', | ||
{ | ||
props: 'never', | ||
children: 'never', | ||
}, | ||
], | ||
|
||
'arrow-body-style': ['error', 'as-needed'], | ||
'react/react-in-jsx-scope': 'off', | ||
camelcase: 'off', | ||
'spaced-comment': 'error', | ||
quotes: ['warn', 'single'], | ||
'no-duplicate-imports': 'error', | ||
'unused-imports/no-unused-imports': 'error', | ||
'unused-imports/no-unused-vars': ['warn'], | ||
}, | ||
settings: { | ||
react:{ | ||
version: 'detect', | ||
} | ||
}, | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
// jest.polyfills.js | ||
global.TextEncoder = require('util').TextEncoder; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.