Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: improved check of whether ignore is global #84

Merged
merged 2 commits into from
Aug 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading