Skip to content

Commit

Permalink
fix: cypress config
Browse files Browse the repository at this point in the history
  • Loading branch information
adamdehaven committed Jun 5, 2024
1 parent e4c45a2 commit 9d53111
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 3 deletions.
19 changes: 19 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit",
"source.fixAll.stylelint": "explicit"
},
"editor.formatOnPaste": true,
"editor.trimAutoWhitespace": true,
"editor.tabSize": 2,
"editor.insertSpaces": true,
"editor.detectIndentation": false,
"eslint.format.enable": true,
"eslint.validate": [
"typescript",
"javascript",
"javascriptreact",
"vue",
"json"
]
}
3 changes: 0 additions & 3 deletions configs/cypress.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ export default [
extends: ['plugin:cypress/recommended'],
}),
{
...compat.config({
extends: ['plugin:cypress/recommended'],
}),
rules: {
'promise/always-return': 'off',
'promise/catch-or-return': 'off',
Expand Down
16 changes: 16 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
import eslintKongUiConfig from './configs/index.mjs'
import eslintKongUiConfigJson from './configs/json.mjs'
import eslintKongUiConfigCypress from './configs/cypress.mjs'

export default [
// Use the main config for all other files
...eslintKongUiConfig,
// Only apply the shared JSON config to files that match the given pattern
...eslintKongUiConfigJson.map(config => ({
...config,
files: ['**/fixtures/**/*.json'],
})),
// Only apply the shared Cypress config to files that match the given pattern
...eslintKongUiConfigCypress.map(config => ({
...config,
files: [
'**/*.cy.{ts,js}',
'**/cypress/**',
],
})),
]
10 changes: 10 additions & 0 deletions fixtures/fake.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
const fake = () => {
const results = [
'one',
'two',
]

return results[0]
}

export { fake }
5 changes: 5 additions & 0 deletions fixtures/test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"json": {
"description": "This file is used to test the JSON config."
}
}

0 comments on commit 9d53111

Please sign in to comment.