2020-01-24 15:39:14 +01:00
|
|
|
module.exports = {
|
2022-08-08 23:33:39 +02:00
|
|
|
parser: '@babel/eslint-parser',
|
|
|
|
extends: ['@strapi/eslint-config/front'],
|
2020-01-24 15:39:14 +01:00
|
|
|
env: {
|
|
|
|
browser: true,
|
|
|
|
commonjs: true,
|
|
|
|
es6: true,
|
|
|
|
jest: true,
|
|
|
|
mocha: true,
|
|
|
|
},
|
|
|
|
parserOptions: {
|
2022-08-08 23:33:39 +02:00
|
|
|
requireConfigFile: false,
|
|
|
|
babelOptions: {
|
|
|
|
presets: ['@babel/preset-react'],
|
2020-01-24 15:39:14 +01:00
|
|
|
},
|
|
|
|
},
|
|
|
|
globals: {
|
|
|
|
strapi: false,
|
|
|
|
window: false,
|
|
|
|
cy: false,
|
|
|
|
Cypress: false,
|
|
|
|
expect: false,
|
|
|
|
assert: false,
|
|
|
|
chai: false,
|
2021-01-29 15:47:11 +01:00
|
|
|
ENABLED_EE_FEATURES: false,
|
2020-01-24 15:39:14 +01:00
|
|
|
// TODO: put all this in process.env in webpack to avoid having to set them here
|
2021-05-05 10:48:27 +02:00
|
|
|
ADMIN_PATH: true,
|
2020-01-24 15:39:14 +01:00
|
|
|
BACKEND_URL: true,
|
|
|
|
PUBLIC_PATH: true,
|
|
|
|
NODE_ENV: true,
|
|
|
|
},
|
|
|
|
settings: {
|
|
|
|
react: {
|
2022-08-08 23:33:39 +02:00
|
|
|
version: 'detect',
|
2020-01-24 15:39:14 +01:00
|
|
|
},
|
|
|
|
},
|
2022-08-09 18:01:17 +02:00
|
|
|
rules: {
|
2023-03-22 11:21:33 +01:00
|
|
|
'prettier/prettier': 'off',
|
2022-08-09 18:01:17 +02:00
|
|
|
'react/jsx-no-constructed-context-values': 'warn',
|
|
|
|
'react/jsx-no-useless-fragment': 'warn',
|
|
|
|
'react/no-unstable-nested-components': 'warn',
|
2023-02-15 16:24:54 +00:00
|
|
|
'no-restricted-imports': [
|
|
|
|
'error',
|
|
|
|
{
|
2023-02-16 17:24:28 +01:00
|
|
|
paths: [
|
|
|
|
{
|
|
|
|
name: '@strapi/design-system',
|
|
|
|
importNames: ['Stack'],
|
|
|
|
message:
|
|
|
|
"'Stack' has been deprecated. Please import 'Flex' from '@strapi/design-system' instead.",
|
|
|
|
},
|
2023-04-19 20:27:47 +01:00
|
|
|
{
|
|
|
|
name: '@strapi/helper-plugin',
|
|
|
|
importNames: ['request'],
|
|
|
|
message:
|
|
|
|
"'request' has been deprecated. Please import 'useFetchClient' from '@strapi/helper-plugin' instead.",
|
|
|
|
},
|
2023-03-17 13:45:45 +01:00
|
|
|
{
|
|
|
|
name: 'lodash',
|
|
|
|
message: 'Please use import [method] from lodash/[method]',
|
|
|
|
},
|
2023-02-16 17:24:28 +01:00
|
|
|
],
|
2023-02-15 16:24:54 +00:00
|
|
|
patterns: [
|
|
|
|
{
|
|
|
|
group: [
|
|
|
|
'@strapi/design-system/*',
|
|
|
|
'!@strapi/design-system/v2',
|
|
|
|
'@strapi/design-system/v2/*',
|
|
|
|
],
|
|
|
|
message: 'Please use the default import from "@strapi/design-system" packages instead.',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
group: ['@strapi/icons/*'],
|
|
|
|
message: 'Please use the default import from "@strapi/icons" packages instead.',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
],
|
2023-05-16 10:56:46 +02:00
|
|
|
'no-restricted-globals': [
|
|
|
|
'error',
|
|
|
|
{
|
|
|
|
name: 'strapi',
|
|
|
|
message: 'Use window.strapi instead.',
|
|
|
|
},
|
|
|
|
],
|
2022-08-09 18:01:17 +02:00
|
|
|
},
|
2020-01-24 15:39:14 +01:00
|
|
|
};
|