mirror of
https://github.com/instructure/canvas-lms.git
synced 2025-08-14 02:33:59 +08:00

Removing non-hook usage of "use" functions in order to make use of react-hooks eslint rules. Change-Id: I4977ac41ecc0c55bc6fa40cf4c6351903e59cb27 Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/365591 Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com> Reviewed-by: Michael Hulse <michael.hulse@instructure.com> QA-Review: Aaron Shafovaloff <ashafovaloff@instructure.com> Product-Review: Aaron Shafovaloff <ashafovaloff@instructure.com>
31 lines
757 B
JavaScript
31 lines
757 B
JavaScript
const pluginJest = require('eslint-plugin-jest')
|
|
|
|
module.exports = {
|
|
files: [
|
|
'**/*.{test,spec}.{js,ts,tsx,jsx}',
|
|
'**/test-utils.js',
|
|
'**/assertions.js',
|
|
'**/testHelpers.js',
|
|
'**/__tests__/*',
|
|
'**/__mocks__/*',
|
|
'jest/**',
|
|
'ui/shared/stub-env/index.js',
|
|
'ui/boot/initializers/__tests__/configureDateTimeWithI18n.t3st.js',
|
|
],
|
|
plugins: {jest: pluginJest},
|
|
languageOptions: {
|
|
globals: {
|
|
...pluginJest.environments.globals.globals,
|
|
global: true,
|
|
},
|
|
},
|
|
rules: {
|
|
'jest/no-disabled-tests': 'warn',
|
|
'jest/no-focused-tests': 'error',
|
|
'jest/no-identical-title': 'warn',
|
|
'jest/prefer-to-have-length': 'warn',
|
|
'jest/valid-expect': 'error',
|
|
'react/no-deprecated': 'warn',
|
|
},
|
|
}
|