-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
convert globals test to use legacy config
- Loading branch information
1 parent
55fa0dd
commit 0e434c7
Showing
8 changed files
with
149 additions
and
67 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
const globals = require('globals') | ||
const { name, version } = require('../package.json') | ||
|
||
const plugin = { | ||
meta: { name, version }, | ||
configs: {}, | ||
rules: { | ||
'no-assigning-return-values': require('./rules/no-assigning-return-values'), | ||
'unsafe-to-chain-command': require('./rules/unsafe-to-chain-command'), | ||
'no-unnecessary-waiting': require('./rules/no-unnecessary-waiting'), | ||
'no-async-before': require('./rules/no-async-before'), | ||
'no-async-tests': require('./rules/no-async-tests'), | ||
'assertion-before-screenshot': require('./rules/assertion-before-screenshot'), | ||
'require-data-selectors': require('./rules/require-data-selectors'), | ||
'no-force': require('./rules/no-force'), | ||
'no-pause': require('./rules/no-pause'), | ||
}, | ||
} | ||
|
||
const commonGlobals = | ||
Object.assign({ | ||
cy: false, | ||
Cypress: false, | ||
expect: false, | ||
assert: false, | ||
chai: false, | ||
}, globals.browser, globals.mocha) | ||
|
||
const commonLanguageOptions = { | ||
ecmaVersion: 2019, | ||
sourceType: 'module' | ||
} | ||
|
||
Object.assign(plugin.configs, { | ||
globals: { | ||
plugins: { | ||
cypress: plugin | ||
}, | ||
languageOptions: { | ||
globals: | ||
commonGlobals, | ||
...commonLanguageOptions | ||
} | ||
} | ||
}) | ||
|
||
Object.assign(plugin.configs, { | ||
recommended: { | ||
plugins: { | ||
cypress: plugin | ||
}, | ||
rules: { | ||
'cypress/no-assigning-return-values': 'error', | ||
'cypress/no-unnecessary-waiting': 'error', | ||
'cypress/no-async-tests': 'error', | ||
'cypress/unsafe-to-chain-command': 'error', | ||
}, | ||
languageOptions: { | ||
globals: | ||
commonGlobals, | ||
...commonLanguageOptions | ||
} | ||
} | ||
}) | ||
|
||
module.exports = plugin |
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