Skip to content

Commit

Permalink
Merge pull request #1004 from 3YOURMIND/add-eslint-plugin-eslint-comm…
Browse files Browse the repository at this point in the history
…ents

dx(eslint): add eslint-plugin-eslint-comments
  • Loading branch information
Isokaeder authored Oct 13, 2024
2 parents de51e24 + deb4797 commit fc3bdd9
Show file tree
Hide file tree
Showing 37 changed files with 64 additions and 3 deletions.
1 change: 0 additions & 1 deletion internals/scripts/source/publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,3 @@ console.info(`attempting to publish ${packagesToPublish.join(', ')}`)
for (const packageName of packagesToPublish) {
await $`yarn run turbo run publish-package --continue --filter=${packageName}`
}
/* eslint-enable no-console */
1 change: 1 addition & 0 deletions packages/documentation/components/LayoutContainer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,5 @@ export default {
},
}
/* eslint-enable perfectionist/sort-objects */
/* eslint-enable @typescript-eslint/explicit-module-boundary-types */
</script>
1 change: 1 addition & 0 deletions packages/documentation/pages/examples/layouts.vue
Original file line number Diff line number Diff line change
Expand Up @@ -233,4 +233,5 @@ export default {
},
}
/* eslint-enable perfectionist/sort-objects */
/* eslint-enable @typescript-eslint/explicit-module-boundary-types */
</script>
1 change: 1 addition & 0 deletions packages/documentation/pages/foundations/colors/figma.vue
Original file line number Diff line number Diff line change
Expand Up @@ -137,4 +137,5 @@ export default {
},
}
/* eslint-enable perfectionist/sort-objects */
/* eslint-enable @typescript-eslint/explicit-module-boundary-types */
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,5 @@ export default {
},
}
/* eslint-enable perfectionist/sort-objects */
/* eslint-enable @typescript-eslint/explicit-module-boundary-types */
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ export default {
},
}
/* eslint-enable perfectionist/sort-objects */
/* eslint-enable @typescript-eslint/explicit-module-boundary-types */
</script>

<style lang="scss" scoped>
Expand Down
1 change: 1 addition & 0 deletions packages/documentation/pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ export default {
},
}
/* eslint-enable perfectionist/sort-objects */
/* eslint-enable @typescript-eslint/explicit-module-boundary-types */
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -1322,6 +1322,7 @@ export default {
},
}
/* eslint-enable perfectionist/sort-objects */
/* eslint-enable @typescript-eslint/explicit-module-boundary-types */
</script>

<style lang="scss" scoped>
Expand Down
3 changes: 2 additions & 1 deletion packages/eslint-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
},
"dependencies": {
"@eslint/js": "^9.3.0",
"@eslint-community/eslint-plugin-eslint-comments": "^4.4.0",
"@typescript-eslint/utils": "^7.11.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-jsonc": "^2.16.0",
Expand Down Expand Up @@ -63,5 +64,5 @@
},
"type": "module",
"types": "./dist/mjs/index.d.ts",
"version": "0.1.0"
"version": "0.1.1"
}
3 changes: 3 additions & 0 deletions packages/eslint-config/source/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import eslint from '@eslint/js'
import comments from '@eslint-community/eslint-plugin-eslint-comments/configs'
import type { TSESLint } from '@typescript-eslint/utils'
import type { SharedConfig } from '@typescript-eslint/utils/ts-eslint'
import jsonc from 'eslint-plugin-jsonc'
Expand Down Expand Up @@ -306,6 +307,7 @@ export default {
*/
global: tseslint.config({
extends: [
comments.recommended,
perfectionist.configs[
'recommended-natural'
] as TSESLint.FlatConfig.Config,
Expand All @@ -328,6 +330,7 @@ export default {
vue: pluginVue,
},
rules: {
'@eslint-community/eslint-comments/no-duplicate-disable': 'off',
'perfectionist/sort-array-includes': [
'error',
{ partitionByComment: true },
Expand Down
2 changes: 2 additions & 0 deletions packages/eslint-config/source/shims.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
declare module 'eslint-plugin-vue/lib/utils/index.js'

declare module '@eslint-community/eslint-plugin-eslint-comments/configs'

declare module 'eslint-plugin-unicorn' {
import type { TSESLint } from '@typescript-eslint/utils'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export default defineComponent({
validators: props.context.validators,
values: computed(() => props.values),
})
/* eslint-enable vue/no-setup-props-reactivity-loss */
},
})
</script>
1 change: 1 addition & 0 deletions packages/kotti-ui/source/kotti-pagination/KtPagination.vue
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ export default {
},
}
/* eslint-enable perfectionist/sort-objects */
/* eslint-enable @typescript-eslint/explicit-module-boundary-types */
</script>

<style lang="scss">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ export default {
},
}
/* eslint-enable perfectionist/sort-objects */
/* eslint-enable @typescript-eslint/explicit-module-boundary-types */
</script>

<style lang="scss" scoped>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ export default {
return this.columns
? this.columns.map((column: any) => {
if (column.key) {
// eslint-disable-next-line
// eslint-disable-next-line no-console
console.warn(
`column ${String(column.prop)} table column property 'key' is deprecated using prop is sufficient to identify the column`,
)
Expand Down Expand Up @@ -369,6 +369,9 @@ export default {
},
},
}
/* eslint-enable perfectionist/sort-objects */
/* eslint-enable @typescript-eslint/explicit-module-boundary-types */
/* eslint-enable @typescript-eslint/no-explicit-any */
</script>

<style lang="scss" scoped>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,3 +164,5 @@ function createColumn(column: any = {}) {

return column
}
/* eslint-enable perfectionist/sort-objects */
/* eslint-enable @typescript-eslint/no-explicit-any */
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,5 @@ const KtTableLegacyConsumer: any = {
}

export { KtTableLegacyConsumer }
/* eslint-enable perfectionist/sort-objects */
/* eslint-enable @typescript-eslint/no-explicit-any */
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,5 @@ export const KtTableLegacyProvider: any = {
}
},
}
/* eslint-enable perfectionist/sort-objects */
/* eslint-enable @typescript-eslint/no-explicit-any */
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,4 @@ export const TableBody = defineComponent({
])
},
})
/* eslint-enable @typescript-eslint/no-explicit-any */
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@ export const TableBodyLoadingRow: any = defineComponent({
])
},
})
/* eslint-enable @typescript-eslint/no-explicit-any */
Original file line number Diff line number Diff line change
Expand Up @@ -247,3 +247,4 @@ export const TableRow = defineComponent({
)
},
})
/* eslint-enable @typescript-eslint/no-explicit-any */
2 changes: 2 additions & 0 deletions packages/kotti-ui/source/kotti-table-legacy/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,3 +116,5 @@ export const DEFAULT_RENDER_HEADER = function defaultRenderHeader(
): [any] {
return [column.label === undefined ? column.prop : column.label]
}
/* eslint-enable @typescript-eslint/explicit-module-boundary-types */
/* eslint-enable @typescript-eslint/no-explicit-any */
2 changes: 2 additions & 0 deletions packages/kotti-ui/source/kotti-table-legacy/logic/column.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,3 +176,5 @@ export const mutations: Store.MutationComponents.Column = {
}

export const getters: Store.GetterComponents.Column = {}
/* eslint-enable @typescript-eslint/explicit-module-boundary-types */
/* eslint-enable @typescript-eslint/no-explicit-any */
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,4 @@ export const getters: Store.GetterComponents.Disable = {
)
},
}
/* eslint-enable @typescript-eslint/no-explicit-any */
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,4 @@ export const getters: Store.GetterComponents.Expand = {
return state.expanded.some((e: any) => isEqual(e, row))
},
}
/* eslint-enable @typescript-eslint/no-explicit-any */
2 changes: 2 additions & 0 deletions packages/kotti-ui/source/kotti-table-legacy/logic/filter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,5 @@ export function setFilteredColumn(state: any, column: any) {
state.filteredColumns.push(column)
}
}
/* eslint-enable @typescript-eslint/no-explicit-any */
/* eslint-enable @typescript-eslint/explicit-module-boundary-types */
2 changes: 2 additions & 0 deletions packages/kotti-ui/source/kotti-table-legacy/logic/hide.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,5 @@ export const mutations: Store.MutationComponents.Hide = {
}

export const getters: Store.GetterComponents.Hide = {}
/* eslint-enable @typescript-eslint/no-explicit-any */
/* eslint-enable @typescript-eslint/explicit-module-boundary-types */
2 changes: 2 additions & 0 deletions packages/kotti-ui/source/kotti-table-legacy/logic/order.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,5 @@ export const mutations: Store.MutationComponents.Order = {
}

export const getters: Store.GetterComponents.Order = {}
/* eslint-enable @typescript-eslint/no-explicit-any */
/* eslint-enable @typescript-eslint/explicit-module-boundary-types */
2 changes: 2 additions & 0 deletions packages/kotti-ui/source/kotti-table-legacy/logic/select.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,3 +123,5 @@ export const getters: Store.GetterComponents.Select = {
return state.selection.some((e: any) => isEqual(e, row))
},
}
/* eslint-enable @typescript-eslint/no-explicit-any */
/* eslint-enable @typescript-eslint/explicit-module-boundary-types */
3 changes: 3 additions & 0 deletions packages/kotti-ui/source/kotti-table-legacy/logic/sort.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,3 +193,6 @@ export const getters: Store.GetterComponents.Sort = {
return column && IS_DSC.test(String(column.sortOrder))
},
}
/* eslint-enable no-param-reassign */
/* eslint-enable @typescript-eslint/no-explicit-any */
/* eslint-enable @typescript-eslint/explicit-module-boundary-types */
2 changes: 2 additions & 0 deletions packages/kotti-ui/source/kotti-table-legacy/logic/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,3 +112,5 @@ export class TableStore {
this.id = table.tableId + '_store'
}
}
/* eslint-enable @typescript-eslint/no-explicit-any */
/* eslint-enable @typescript-eslint/explicit-module-boundary-types */
2 changes: 2 additions & 0 deletions packages/kotti-ui/source/kotti-table-legacy/logic/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -304,3 +304,5 @@ export module Store {
]
}
}

/* eslint-enable @typescript-eslint/no-explicit-any */
1 change: 1 addition & 0 deletions packages/kotti-ui/source/kotti-table-legacy/mixins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,4 @@ export const TableColumnsStateMixin = {
},
},
}
/* eslint-enable perfectionist/sort-objects */
2 changes: 2 additions & 0 deletions packages/kotti-ui/source/kotti-table-legacy/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,3 +260,5 @@ export module KottiTableLegacy {
export type Loading = undefined
}
}

/* eslint-enable perfectionist/sort-object-types */
1 change: 1 addition & 0 deletions packages/kotti-ui/source/kotti-toaster/KtToaster.vue
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ export default {
},
}
/* eslint-enable perfectionist/sort-objects */
/* eslint-enable @typescript-eslint/explicit-module-boundary-types */
</script>

<style lang="scss" scoped>
Expand Down
1 change: 1 addition & 0 deletions packages/kotti-ui/source/make-props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -328,3 +328,4 @@ export const makeProps = <PROPS_SCHEMA extends z.ZodObject<z.ZodRawShape>>(
type: PropType<z.output<PROPS_SCHEMA>[KEY]>
}
}
/* eslint-enable @typescript-eslint/no-unnecessary-condition */
8 changes: 8 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1706,6 +1706,14 @@
resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.20.2.tgz#9c907b21e30a52db959ba4f80bb01a0cc403d5cc"
integrity sha512-N49X4lJX27+l9jbLKSqZ6bKNjzQvHaT8IIFUy+YIqmXQdjYCToGWwOItDrfby14c78aDd5NHQl29xingXfCdLQ==

"@eslint-community/eslint-plugin-eslint-comments@^4.4.0":
version "4.4.0"
resolved "https://registry.yarnpkg.com/@eslint-community/eslint-plugin-eslint-comments/-/eslint-plugin-eslint-comments-4.4.0.tgz#1fedd85e7c11dcea5764ec3dee5829a2cc117821"
integrity sha512-yljsWl5Qv3IkIRmJ38h3NrHXFCm4EUl55M8doGTF6hvzvFF8kRpextgSrg2dwHev9lzBZyafCr9RelGIyQm6fw==
dependencies:
escape-string-regexp "^4.0.0"
ignore "^5.2.4"

"@eslint-community/eslint-utils@^4.2.0", "@eslint-community/eslint-utils@^4.4.0":
version "4.4.0"
resolved "https://registry.yarnpkg.com/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz#a23514e8fb9af1269d5f7788aa556798d61c6b59"
Expand Down

0 comments on commit fc3bdd9

Please sign in to comment.