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