@evaneos/front-config 5.1.0 → 5.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/eslint/index.js +21 -4
- package/eslint/index.mjs +21 -4
- package/package.json +1 -1
package/eslint/index.js
CHANGED
|
@@ -3124,9 +3124,25 @@ var test_default = [
|
|
|
3124
3124
|
];
|
|
3125
3125
|
|
|
3126
3126
|
// src/eslint/rules/override.ts
|
|
3127
|
+
var import_fs = require("fs");
|
|
3128
|
+
var import_path = require("path");
|
|
3129
|
+
function hasNextJs() {
|
|
3130
|
+
try {
|
|
3131
|
+
const packageJsonPath = (0, import_path.join)(process.cwd(), "package.json");
|
|
3132
|
+
if (!(0, import_fs.existsSync)(packageJsonPath)) {
|
|
3133
|
+
return false;
|
|
3134
|
+
}
|
|
3135
|
+
const packageJsonContent = (0, import_fs.readFileSync)(packageJsonPath, "utf8");
|
|
3136
|
+
const packageJson = JSON.parse(packageJsonContent);
|
|
3137
|
+
const dependencies = __spreadValues(__spreadValues({}, packageJson.dependencies), packageJson.devDependencies);
|
|
3138
|
+
return "next" in dependencies;
|
|
3139
|
+
} catch (e) {
|
|
3140
|
+
return false;
|
|
3141
|
+
}
|
|
3142
|
+
}
|
|
3127
3143
|
var override_default = [
|
|
3128
3144
|
{
|
|
3129
|
-
rules: {
|
|
3145
|
+
rules: __spreadValues({
|
|
3130
3146
|
"no-process-env": 0,
|
|
3131
3147
|
"prefer-const": 1,
|
|
3132
3148
|
"prefer-destructuring": 1,
|
|
@@ -3138,19 +3154,20 @@ var override_default = [
|
|
|
3138
3154
|
"react/jsx-uses-react": "error",
|
|
3139
3155
|
"react/jsx-uses-vars": "error",
|
|
3140
3156
|
"@typescript-eslint/no-unsafe-member-access": "off",
|
|
3141
|
-
"@typescript-eslint/no-unsafe-assignment": "off"
|
|
3157
|
+
"@typescript-eslint/no-unsafe-assignment": "off"
|
|
3158
|
+
}, hasNextJs() ? {
|
|
3142
3159
|
"no-restricted-imports": [
|
|
3143
3160
|
"warn",
|
|
3144
3161
|
{
|
|
3145
3162
|
paths: [
|
|
3146
3163
|
{
|
|
3147
3164
|
name: "react-intl",
|
|
3148
|
-
message: "
|
|
3165
|
+
message: "Use next-intl instead of react-intl. Docs: https://next-intl-docs.vercel.app/ | ADR: https://www.notion.so/leather-yard-6b5/ADR-Next-intl-et-internationalisation-d-une-app-Next-17da97006602800bafd9cf4ebdfde508"
|
|
3149
3166
|
}
|
|
3150
3167
|
]
|
|
3151
3168
|
}
|
|
3152
3169
|
]
|
|
3153
|
-
}
|
|
3170
|
+
} : {})
|
|
3154
3171
|
}
|
|
3155
3172
|
];
|
|
3156
3173
|
|
package/eslint/index.mjs
CHANGED
|
@@ -3113,9 +3113,25 @@ var test_default = [
|
|
|
3113
3113
|
];
|
|
3114
3114
|
|
|
3115
3115
|
// src/eslint/rules/override.ts
|
|
3116
|
+
import { existsSync, readFileSync } from "fs";
|
|
3117
|
+
import { join } from "path";
|
|
3118
|
+
function hasNextJs() {
|
|
3119
|
+
try {
|
|
3120
|
+
const packageJsonPath = join(process.cwd(), "package.json");
|
|
3121
|
+
if (!existsSync(packageJsonPath)) {
|
|
3122
|
+
return false;
|
|
3123
|
+
}
|
|
3124
|
+
const packageJsonContent = readFileSync(packageJsonPath, "utf8");
|
|
3125
|
+
const packageJson = JSON.parse(packageJsonContent);
|
|
3126
|
+
const dependencies = __spreadValues(__spreadValues({}, packageJson.dependencies), packageJson.devDependencies);
|
|
3127
|
+
return "next" in dependencies;
|
|
3128
|
+
} catch (e) {
|
|
3129
|
+
return false;
|
|
3130
|
+
}
|
|
3131
|
+
}
|
|
3116
3132
|
var override_default = [
|
|
3117
3133
|
{
|
|
3118
|
-
rules: {
|
|
3134
|
+
rules: __spreadValues({
|
|
3119
3135
|
"no-process-env": 0,
|
|
3120
3136
|
"prefer-const": 1,
|
|
3121
3137
|
"prefer-destructuring": 1,
|
|
@@ -3127,19 +3143,20 @@ var override_default = [
|
|
|
3127
3143
|
"react/jsx-uses-react": "error",
|
|
3128
3144
|
"react/jsx-uses-vars": "error",
|
|
3129
3145
|
"@typescript-eslint/no-unsafe-member-access": "off",
|
|
3130
|
-
"@typescript-eslint/no-unsafe-assignment": "off"
|
|
3146
|
+
"@typescript-eslint/no-unsafe-assignment": "off"
|
|
3147
|
+
}, hasNextJs() ? {
|
|
3131
3148
|
"no-restricted-imports": [
|
|
3132
3149
|
"warn",
|
|
3133
3150
|
{
|
|
3134
3151
|
paths: [
|
|
3135
3152
|
{
|
|
3136
3153
|
name: "react-intl",
|
|
3137
|
-
message: "
|
|
3154
|
+
message: "Use next-intl instead of react-intl. Docs: https://next-intl-docs.vercel.app/ | ADR: https://www.notion.so/leather-yard-6b5/ADR-Next-intl-et-internationalisation-d-une-app-Next-17da97006602800bafd9cf4ebdfde508"
|
|
3138
3155
|
}
|
|
3139
3156
|
]
|
|
3140
3157
|
}
|
|
3141
3158
|
]
|
|
3142
|
-
}
|
|
3159
|
+
} : {})
|
|
3143
3160
|
}
|
|
3144
3161
|
];
|
|
3145
3162
|
|