Skip to content

Commit

Permalink
fix: improved check of whether ignore is global (#84)
Browse files Browse the repository at this point in the history
  • Loading branch information
voxpelli authored Aug 15, 2024
1 parent cf803a6 commit 7e66113
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion app/components/ConfigItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,19 @@ const emit = defineEmits<{
badgeClick: [string]
}>()
/**
* Fields that are considered metadata and not part of the config object.
* @type {Set<string>}
* @see {@link https://github.com/eslint/rewrite/blob/e2a7ec809db20e638abbad250d105ddbde88a8d5/packages/config-array/src/config-array.js#L72-L76}
*/
const META_FIELDS = new Set(['name'])
/**
* Fields that are added to configs internally by config inspector.
* @type {Set<string>}
*/
const CONFIG_INSPECTOR_FIELDS = new Set(['index'])
const open = defineModel('open', {
default: true,
})
Expand Down Expand Up @@ -147,7 +160,7 @@ const extraConfigs = computed(() => {
<div v-if="config.ignores" flex="~ gap-2 items-start">
<div i-ph-eye-closed-duotone my1 flex-none />
<div flex="~ col gap-2">
<div v-if="!config.files">
<div v-if="Object.keys(config).some(key => key !== 'ignores' && !CONFIG_INSPECTOR_FIELDS.has(key) && !META_FIELDS.has(key)) === false">
Ignore files globally
</div>
<div v-else>
Expand Down

0 comments on commit 7e66113

Please sign in to comment.