2020-02-14 02:23:21 +00:00
|
|
|
module.exports = {
|
2021-07-14 20:38:57 +00:00
|
|
|
env: {
|
|
|
|
'jest/globals': true,
|
|
|
|
},
|
2020-07-28 02:32:58 +00:00
|
|
|
extends: [ 'plugin:@woocommerce/eslint-plugin/recommended' ],
|
2021-03-10 15:11:37 +00:00
|
|
|
settings: {
|
2021-03-18 03:38:38 +00:00
|
|
|
'import/resolver': 'typescript',
|
2022-01-06 12:53:30 +00:00
|
|
|
// List of modules that are externals in our webpack config.
|
|
|
|
'import/core-modules': [ '@woocommerce/settings', 'lodash', 'react' ],
|
2021-07-27 14:53:03 +00:00
|
|
|
react: {
|
|
|
|
pragma: 'createElement',
|
|
|
|
},
|
2021-03-10 15:11:37 +00:00
|
|
|
},
|
2022-03-04 04:01:16 +00:00
|
|
|
root: true,
|
2020-02-14 02:23:21 +00:00
|
|
|
rules: {
|
2020-07-28 02:32:58 +00:00
|
|
|
// temporary conversion to warnings until the below are all handled.
|
|
|
|
'@wordpress/i18n-translator-comments': 'warn',
|
|
|
|
'@wordpress/valid-sprintf': 'warn',
|
2020-08-20 02:15:08 +00:00
|
|
|
'jsdoc/check-tag-names': [
|
|
|
|
'error',
|
2021-07-08 23:01:43 +00:00
|
|
|
{
|
|
|
|
definedTags: [
|
|
|
|
'jest-environment',
|
|
|
|
'filter',
|
|
|
|
'action',
|
|
|
|
'slotFill',
|
2022-02-11 14:38:38 +00:00
|
|
|
'scope',
|
2021-07-08 23:01:43 +00:00
|
|
|
],
|
|
|
|
},
|
2020-08-20 02:15:08 +00:00
|
|
|
],
|
2021-01-26 00:24:28 +00:00
|
|
|
'import/no-extraneous-dependencies': 'warn',
|
|
|
|
'import/no-unresolved': 'warn',
|
|
|
|
'jest/no-deprecated-functions': 'warn',
|
|
|
|
'@wordpress/no-unsafe-wp-apis': 'warn',
|
|
|
|
'jest/valid-title': 'warn',
|
|
|
|
'@wordpress/no-global-active-element': 'warn',
|
2021-07-14 20:38:57 +00:00
|
|
|
'no-unused-vars': [
|
|
|
|
'error',
|
|
|
|
{
|
|
|
|
varsIgnorePattern: 'createElement',
|
|
|
|
},
|
|
|
|
],
|
2021-07-27 14:53:03 +00:00
|
|
|
'react/react-in-jsx-scope': 'error',
|
2020-02-14 02:23:21 +00:00
|
|
|
},
|
2021-03-01 03:01:22 +00:00
|
|
|
overrides: [
|
|
|
|
{
|
|
|
|
files: [ '*.ts', '*.tsx' ],
|
|
|
|
parser: '@typescript-eslint/parser',
|
|
|
|
extends: [
|
|
|
|
'plugin:@woocommerce/eslint-plugin/recommended',
|
|
|
|
'plugin:@typescript-eslint/recommended',
|
|
|
|
],
|
|
|
|
rules: {
|
2021-03-18 03:38:38 +00:00
|
|
|
camelcase: 'off',
|
|
|
|
'import/no-unresolved': 'warn',
|
|
|
|
'import/no-extraneous-dependencies': 'warn',
|
2021-03-01 03:01:22 +00:00
|
|
|
'@typescript-eslint/no-explicit-any': 'error',
|
|
|
|
'no-use-before-define': 'off',
|
|
|
|
'@typescript-eslint/no-use-before-define': [ 'error' ],
|
|
|
|
'jsdoc/require-param': 'off',
|
2021-04-20 17:17:19 +00:00
|
|
|
// Making use of typescript no-shadow instead, fixes issues with enum.
|
|
|
|
'no-shadow': 'off',
|
|
|
|
'@typescript-eslint/no-shadow': [ 'error' ],
|
2021-05-18 19:46:21 +00:00
|
|
|
'@typescript-eslint/no-empty-function': 'off',
|
2021-07-27 14:53:03 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
files: [
|
|
|
|
'client/**/*.js',
|
|
|
|
'client/**/*.jsx',
|
|
|
|
'**/stories/*.js',
|
|
|
|
'**/stories/*.jsx',
|
|
|
|
'**/docs/example.js',
|
|
|
|
],
|
|
|
|
rules: {
|
|
|
|
'react/react-in-jsx-scope': 'off',
|
2021-03-01 03:01:22 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
2020-02-14 02:23:21 +00:00
|
|
|
};
|