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