chore(eslint-config): add newline-after-import rules (#20309)

chore: add `newline-after-import` rules
This commit is contained in:
sea 2025-03-31 20:48:10 +08:00 committed by GitHub
parent 4ef26b935c
commit 1084071fcf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
19 changed files with 24 additions and 1 deletions

View File

@ -121,7 +121,6 @@ module.exports = defineConfig({
],
},
},
{
files: ['**/*.md/*.js', '**/*.md/*.ts'],
rules: {
@ -130,6 +129,12 @@ module.exports = defineConfig({
'@typescript-eslint/no-unused-vars': 'off',
},
},
{
files: ['!docs/**/*.{js,ts,vue}'],
rules: {
'import/newline-after-import': ['error', { count: 1 }],
},
},
],
rules: {
// js/ts

View File

@ -1,6 +1,7 @@
import { withInstall } from '@element-plus/utils'
import Affix from './src/affix.vue'
import type { SFCWithInstall } from '@element-plus/utils'
export const ElAffix: SFCWithInstall<typeof Affix> = withInstall(Affix)
export default ElAffix

View File

@ -1,6 +1,7 @@
// @ts-nocheck
import { defineComponent, h } from 'vue'
import { useNamespace } from '@element-plus/hooks'
export default defineComponent({
name: 'NodeContent',
setup() {

View File

@ -75,6 +75,7 @@ import { DArrowLeft, DArrowRight, MoreFilled } from '@element-plus/icons-vue'
import { useLocale, useNamespace } from '@element-plus/hooks'
import { CHANGE_EVENT } from '@element-plus/constants'
import { paginationPagerProps } from './pager'
defineOptions({
name: 'ElPaginationPager',
})

View File

@ -8,6 +8,7 @@ import { radioGroupKey } from './constants'
import type { RadioButtonProps } from './radio-button'
import type { SetupContext } from 'vue'
import type { RadioEmits, RadioProps } from './radio'
export const useRadio = (
props: RadioProps | RadioButtonProps,
emit?: SetupContext<RadioEmits>['emit']

View File

@ -13,6 +13,7 @@ import {
ROVING_FOCUS_GROUP_ITEM_INJECTION_KEY,
} from '../src/tokens'
import ElRovingFocusItem from '../src/roving-focus-item.vue'
const AXIOM = 'rem is the best girl'
const focusItemKls = 'item-kls'

View File

@ -7,6 +7,7 @@ import type {
} from 'vue'
import type { ISelectProps } from './select'
import type { optionProps } from './option'
export interface SelectGroupContext {
disabled: boolean
}

View File

@ -8,6 +8,7 @@ import type { Store } from '../store'
import type { PropType } from 'vue'
import type { DefaultRow, Sort, SummaryMethod } from '../table/defaults'
export interface TableFooter<T> {
fixed: string
store: Store<T>

View File

@ -21,6 +21,7 @@ import useUtils from './utils-helper'
import type { ComponentInternalInstance, PropType, Ref } from 'vue'
import type { DefaultRow, Sort } from '../table/defaults'
import type { Store } from '../store'
export interface TableHeader extends ComponentInternalInstance {
state: {
onColumnsChange

View File

@ -9,6 +9,7 @@ import type { TableColumnCtx } from './table-column/defaults'
import type { TableHeader } from './table-header'
import type { Table } from './table/defaults'
import type { Store } from './store'
class TableLayout<T> {
observers: TableHeader[]
table: Table<T>

View File

@ -7,6 +7,7 @@ import Picker from './common/picker.vue'
import TimePickPanel from './time-picker-com/panel-time-pick.vue'
import TimeRangePanel from './time-picker-com/panel-time-range.vue'
import { timePickerDefaultProps } from './common/props'
dayjs.extend(customParseFormat)
export default defineComponent({

View File

@ -3,6 +3,7 @@ import { isArray, isDate, isEmpty } from '@element-plus/utils'
import type { Dayjs } from 'dayjs'
import type { DateOrDates, DayOrDays } from './common/props'
export type TimeList = [number | undefined, number, undefined | number]
export const buildTimeList = (value: number, bound: number): TimeList => {

View File

@ -6,6 +6,7 @@ import customParseFormat from 'dayjs/plugin/customParseFormat.js'
import Select from '@element-plus/components/select'
import { ElFormItem } from '@element-plus/components/form'
import TimeSelect from '../src/time-select.vue'
dayjs.extend(customParseFormat)
const { Option } = Select

View File

@ -12,6 +12,7 @@ import { DynamicSizeList } from '..'
import setupMock from './setup-mock'
import type { ListExposes } from '../src/types'
type ListRef = ListExposes
const onItemRendered = vi.fn()

View File

@ -16,6 +16,7 @@ import setupMock from './setup-mock'
import type { SpyInstance } from 'vitest'
import type { ListExposes } from '../src/types'
type ListRef = ListExposes
const onItemRendered = vi.fn()

View File

@ -18,6 +18,7 @@ import { virtualizedScrollbarProps } from '../props'
import { renderThumbStyle } from '../utils'
import type { CSSProperties } from 'vue'
interface ScrollState {
isDragging: boolean
traveled: number

View File

@ -8,6 +8,7 @@
import { computed } from 'vue'
import { visualHiddenProps } from './visual-hidden'
import type { StyleValue } from 'vue'
const props = defineProps(visualHiddenProps)
defineOptions({

View File

@ -1,4 +1,5 @@
import installer from './defaults'
export * from '@element-plus/components'
export * from '@element-plus/constants'
export * from '@element-plus/directives'

View File

@ -1,4 +1,5 @@
import { capitalize as toCapitalize } from '@vue/shared'
export {
camelize,
hyphenate,