generated from zhouhua/obsidian-markdown-media-card
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Optimize the scrolling effect & update eslint rules
- Loading branch information
Showing
17 changed files
with
826 additions
and
464 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"outputPath": "./i18n/", | ||
"adapters": [], | ||
"$schema": "https://unpkg.com/typesafe-i18n@5.26.2/schema/typesafe-i18n.json" | ||
} | ||
"outputPath": "./i18n/", | ||
"adapters": [], | ||
"$schema": "https://unpkg.com/typesafe-i18n@5.26.2/schema/typesafe-i18n.json" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,179 @@ | ||
import stylistic from '@stylistic/eslint-plugin'; | ||
import eslint from '@eslint/js'; | ||
import tseslint from 'typescript-eslint'; | ||
|
||
export default tseslint.config({ | ||
extends: [ | ||
eslint.configs.recommended, | ||
...tseslint.configs.recommendedTypeChecked, | ||
stylistic.configs['recommended-flat'], | ||
], | ||
plugins: { | ||
'@stylistic': stylistic, | ||
}, | ||
languageOptions: { | ||
parserOptions: { | ||
project: true, | ||
tsconfigRootDir: import.meta.dirname, | ||
}, | ||
}, | ||
}, | ||
{ | ||
ignores: [ | ||
'main.js', | ||
'typings/**', | ||
], | ||
}, | ||
{ | ||
|
||
rules: { | ||
'no-unused-vars': 'off', | ||
'no-dupe-class-members': 'off', | ||
'no-loop-func': 'off', | ||
'no-shadow': 'off', | ||
'no-unused-expressions': 'off', | ||
'no-use-before-define': 'off', | ||
'no-throw-literal': 'off', | ||
'prefer-destructuring': 'off', | ||
|
||
'@stylistic/ban-ts-comment': 'off', | ||
'@stylistic/no-prototype-builtins': 'off', | ||
'@stylistic/no-empty-function': 'off', | ||
'@stylistic/semi': ['error', 'always'], | ||
'@stylistic/arrow-parens': ['error', 'as-needed'], | ||
'@stylistic/array-bracket-newline': 'error', | ||
'@stylistic/array-element-newline': ['error', 'consistent'], | ||
'@stylistic/function-call-argument-newline': ['error', 'consistent'], | ||
'@stylistic/function-call-spacing': ['error', 'never'], | ||
'@stylistic/generator-star-spacing': ['error', 'before'], | ||
'@stylistic/max-len': [ | ||
'error', { | ||
code: 120, | ||
ignoreComments: true, | ||
ignoreUrls: true, | ||
ignoreStrings: true, | ||
ignoreTemplateLiterals: true, | ||
ignoreRegExpLiterals: true, | ||
ignoreTrailingComments: true, | ||
}, | ||
], | ||
'@stylistic/linebreak-style': ['error', 'unix'], | ||
'@stylistic/no-confusing-arrow': 'error', | ||
'@stylistic/no-extra-semi': 'error', | ||
'@stylistic/object-curly-newline': [ | ||
'error', { | ||
multiline: true, | ||
consistent: true, | ||
}, | ||
], | ||
'@stylistic/one-var-declaration-per-line': ['error', 'always'], | ||
'@stylistic/semi-style': ['error', 'last'], | ||
'@stylistic/switch-colon-spacing': ['error', { after: true, before: false }], | ||
'@stylistic/jsx-pascal-case': [ | ||
'error', { | ||
allowAllCaps: false, | ||
allowLeadingUnderscore: false, | ||
allowNamespace: true, | ||
}, | ||
], | ||
'@stylistic/jsx-props-no-multi-spaces': 'error', | ||
'@stylistic/jsx-self-closing-comp': [ | ||
'error', { | ||
component: true, | ||
html: false, | ||
}, | ||
], | ||
'@stylistic/jsx-sort-props': [ | ||
'error', { | ||
callbacksLast: true, | ||
shorthandFirst: true, | ||
multiline: 'first', | ||
noSortAlphabetically: true, | ||
reservedFirst: true, | ||
}, | ||
], | ||
'@stylistic/member-delimiter-style': [ | ||
'error', { | ||
multiline: { | ||
delimiter: 'semi', | ||
requireLast: true, | ||
}, | ||
multilineDetection: 'brackets', | ||
singleline: { | ||
delimiter: 'semi', | ||
requireLast: true, | ||
}, | ||
}, | ||
], | ||
'@typescript-eslint/no-floating-promises': 'off', | ||
'@stylistic/object-property-newline': [ | ||
'error', { | ||
allowAllPropertiesOnSameLine: true, | ||
}, | ||
], | ||
|
||
'@typescript-eslint/no-unused-vars': ['error', { args: 'none' }], | ||
'@typescript-eslint/adjacent-overload-signatures': 'error', | ||
'@typescript-eslint/consistent-indexed-object-style': 'error', | ||
'@typescript-eslint/consistent-type-assertions': ['error', { assertionStyle: 'never' }], | ||
'@typescript-eslint/consistent-type-definitions': 'error', | ||
'@typescript-eslint/consistent-type-exports': ['error', { fixMixedExportsWithInlineTypeSpecifier: false }], | ||
'@typescript-eslint/consistent-type-imports': [ | ||
'error', { | ||
prefer: 'type-imports', | ||
fixStyle: 'separate-type-imports', | ||
disallowTypeAnnotations: true, | ||
}, | ||
], | ||
'@typescript-eslint/member-ordering': ['warn'], | ||
'@typescript-eslint/no-array-delete': 'error', | ||
'@typescript-eslint/no-confusing-non-null-assertion': 'error', | ||
'@typescript-eslint/no-confusing-void-expression': 'error', | ||
'@typescript-eslint/no-dupe-class-members': 'error', | ||
'@typescript-eslint/no-dynamic-delete': 'error', | ||
'@typescript-eslint/no-empty-interface': 'error', | ||
'@typescript-eslint/no-empty-object-type': 'error', | ||
'@typescript-eslint/no-invalid-void-type': 'error', | ||
'@typescript-eslint/no-loop-func': 'error', | ||
'@typescript-eslint/no-meaningless-void-operator': 'error', | ||
'@typescript-eslint/no-mixed-enums': 'error', | ||
'@typescript-eslint/no-non-null-asserted-nullish-coalescing': 'error', | ||
'@typescript-eslint/no-require-imports': 'error', | ||
'@typescript-eslint/no-shadow': [ | ||
'error', | ||
{ | ||
builtinGlobals: false, | ||
hoist: 'all', | ||
allow: [], | ||
ignoreTypeValueShadow: false, | ||
ignoreFunctionTypeParameterNameValueShadow: false, | ||
}, | ||
], | ||
'@typescript-eslint/no-unnecessary-boolean-literal-compare': 'error', | ||
'@typescript-eslint/no-unnecessary-condition': 'error', | ||
'@typescript-eslint/no-unnecessary-qualifier': 'error', | ||
'@typescript-eslint/no-unnecessary-template-expression': 'error', | ||
'@typescript-eslint/no-unused-expressions': [ | ||
'error', { | ||
allowShortCircuit: true, | ||
allowTernary: true, | ||
allowTaggedTemplates: true, | ||
}, | ||
], | ||
'@typescript-eslint/no-use-before-define': 'error', | ||
'@typescript-eslint/no-useless-empty-export': 'error', | ||
'@typescript-eslint/only-throw-error': 'error', | ||
'@typescript-eslint/prefer-destructuring': 'error', | ||
'@typescript-eslint/prefer-enum-initializers': 'error', | ||
'@typescript-eslint/prefer-find': 'error', | ||
'@typescript-eslint/prefer-for-of': 'error', | ||
'@typescript-eslint/prefer-includes': 'error', | ||
'@typescript-eslint/prefer-namespace-keyword': 'error', | ||
'@typescript-eslint/prefer-optional-chain': 'error', | ||
'@typescript-eslint/prefer-reduce-type-parameter': 'error', | ||
'@typescript-eslint/prefer-string-starts-ends-with': 'error', | ||
'@typescript-eslint/require-array-sort-compare': 'error', | ||
'@typescript-eslint/switch-exhaustiveness-check': 'error', | ||
'@typescript-eslint/unified-signatures': 'error', | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
import type { BaseTranslation } from "../i18n-types"; | ||
import type { BaseTranslation } from '../i18n-types'; | ||
|
||
const en: BaseTranslation = { | ||
setting: { | ||
mode: { | ||
title: "Mode", | ||
description: "By default, display the current heading, the parent heading, and the siblings of the parent heading. In concise mode, only display the current heading and the parent heading.", | ||
default: "Default", | ||
concise: "Concise", | ||
}, | ||
max: { | ||
title: "Display quantity limit", | ||
description: 'Maximum number of headings that can be displayed. 0 indicates no limit.' | ||
} | ||
} | ||
setting: { | ||
mode: { | ||
title: 'Mode', | ||
description: 'By default, display the current heading, the parent heading, and the siblings of the parent heading. In concise mode, only display the current heading and the parent heading.', | ||
default: 'Default', | ||
concise: 'Concise', | ||
}, | ||
max: { | ||
title: 'Display quantity limit', | ||
description: 'Maximum number of headings that can be displayed. 0 indicates no limit.', | ||
}, | ||
}, | ||
}; | ||
|
||
export default en; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,10 @@ | ||
import type { FormattersInitializer } from 'typesafe-i18n' | ||
import type { Locales, Formatters } from './i18n-types' | ||
import type { FormattersInitializer } from 'typesafe-i18n'; | ||
import type { Locales, Formatters } from './i18n-types'; | ||
|
||
export const initFormatters: FormattersInitializer<Locales, Formatters> = (locale: Locales) => { | ||
const formatters: Formatters = { | ||
// add your formatter functions here | ||
}; | ||
|
||
const formatters: Formatters = { | ||
// add your formatter functions here | ||
} | ||
|
||
return formatters | ||
} | ||
return formatters; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
import type { Translation } from "../i18n-types"; | ||
import type { Translation } from '../i18n-types'; | ||
|
||
const zh: Translation = { | ||
setting: { | ||
mode: { | ||
title: "模式", | ||
description: "默认情况下,显示当前标题、父标题和父标题的兄弟标题。简洁模式下,仅显示当前标题和父标题。", | ||
default: "默认", | ||
concise: "简洁", | ||
}, | ||
max: { | ||
title: "显示数量限制", | ||
description: '最大显示标题数量,0 表示不限制。', | ||
} | ||
} | ||
setting: { | ||
mode: { | ||
title: '模式', | ||
description: '默认情况下,显示当前标题、父标题和父标题的兄弟标题。简洁模式下,仅显示当前标题和父标题。', | ||
default: '默认', | ||
concise: '简洁', | ||
}, | ||
max: { | ||
title: '显示数量限制', | ||
description: '最大显示标题数量,0 表示不限制。', | ||
}, | ||
}, | ||
}; | ||
|
||
export default zh; |
Oops, something went wrong.