@nitra/eslint-config 2.0.20 → 2.0.22
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/index.js +6 -5
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -50,6 +50,8 @@ const all = [
|
|
|
50
50
|
'unicorn/prefer-ternary': 'off',
|
|
51
51
|
'unicorn/no-array-push-push': 'off',
|
|
52
52
|
'unicorn/explicit-length-check': 'off',
|
|
53
|
+
'unicorn/prefer-number-properties': 'off',
|
|
54
|
+
'unicorn/no-object-as-default-parameter': 'off',
|
|
53
55
|
'unicorn/numeric-separators-style': [
|
|
54
56
|
'error',
|
|
55
57
|
{ onlyIfContainsSeparator: true, binary: { onlyIfContainsSeparator: false } }
|
|
@@ -76,8 +78,7 @@ const vueVite = [
|
|
|
76
78
|
{
|
|
77
79
|
languageOptions: {
|
|
78
80
|
globals: {
|
|
79
|
-
process: 'readonly'
|
|
80
|
-
__dirname: 'readonly'
|
|
81
|
+
process: 'readonly'
|
|
81
82
|
}
|
|
82
83
|
}
|
|
83
84
|
}
|
|
@@ -149,14 +150,14 @@ const vue = [
|
|
|
149
150
|
|
|
150
151
|
/**
|
|
151
152
|
* Eslint правила
|
|
152
|
-
*
|
|
153
153
|
* @param {{node?: Array, vue?: Array}} params список директорій до яких примінити Eslint правили
|
|
154
|
+
* @returns {Array} конфігурації eslint
|
|
154
155
|
*/
|
|
155
156
|
export function getConfig(params = { node: [], vue: [] }) {
|
|
156
157
|
const result = all
|
|
157
158
|
|
|
158
159
|
// якщо присутні nodejs проекти в monorepo
|
|
159
|
-
if (params.node) {
|
|
160
|
+
if (params.node?.length) {
|
|
160
161
|
const files = params.node.map(name => `${name}/**/*.js`)
|
|
161
162
|
const nodeConfig = node.map(configObject => ({
|
|
162
163
|
files,
|
|
@@ -166,7 +167,7 @@ export function getConfig(params = { node: [], vue: [] }) {
|
|
|
166
167
|
}
|
|
167
168
|
|
|
168
169
|
// якщо присутні nodejs проекти в monorepo
|
|
169
|
-
if (params.vue) {
|
|
170
|
+
if (params.vue?.length) {
|
|
170
171
|
// по певним файлам правили
|
|
171
172
|
const filesVite = params.vue.map(name => `${name}/**/vite.config.js`)
|
|
172
173
|
const vueViteConfig = vueVite.map(configObject => ({
|