Skip to content

Commit

Permalink
Updated dependencies and fixed styles from changes
Browse files Browse the repository at this point in the history
  • Loading branch information
matthew-holder-revvity committed Nov 2, 2024
1 parent 671b757 commit 548ec66
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 40 deletions.
44 changes: 23 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@
"compile": "tsc",
"copy": "cpy 'src/**/*.{js,jsx,cjs,mjs,d.ts,d.tsx,d.cts,d.mts}' dist/",
"clean": "del dist/",
"typecheck": "tsc --noEmit",
"lint:eslint": "eslint .",
"lint:prettier": "prettier -cu .",
"lint": "run-p -l 'lint:*'",
"lint": "run-p -l typecheck 'lint:*'",
"fix:eslint": "eslint --fix .",
"fix:prettier": "prettier -cu --write .",
"fix": "run-s -l 'fix:*'",
"fix": "run-s -l typecheck 'fix:*'",
"prepare": "husky",
"prepack": "yarn run rebuild"
},
Expand All @@ -50,45 +51,46 @@
"@tsconfig/node18": "^18.2.4",
"@tsconfig/strictest": "^2.0.5",
"@types/debug": "^4.1.12",
"@types/lodash": "^4.17.7",
"@types/node": "18.19.44",
"@typescript-eslint/eslint-plugin": "^8.1.0",
"@typescript-eslint/parser": "^8.1.0",
"@types/eslint__eslintrc": "^2.1.2",
"@types/lodash": "^4.17.13",
"@types/node": "18.19.63",
"@typescript-eslint/eslint-plugin": "^8.12.2",
"@typescript-eslint/parser": "^8.12.2",
"@vue/eslint-config-prettier": "^9.0.0",
"@vue/eslint-config-typescript": "^13.0.0",
"cpy-cli": "^5.0.0",
"del-cli": "^5.1.0",
"eslint-config-prettier": "^9.1.0",
"eslint-import-resolver-node": "^0.3.9",
"eslint-import-resolver-typescript": "^3.6.1",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-n": "^17.10.2",
"eslint-import-resolver-typescript": "^3.6.3",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-n": "^17.12.0",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-promise": "^7.1.0",
"eslint-plugin-vue": "^9.27.0",
"husky": "^9.1.4",
"npm-check-updates": "^17.0.6",
"npm-run-all2": "^6.2.2",
"eslint-plugin-vue": "^9.30.0",
"husky": "^9.1.6",
"npm-check-updates": "^17.1.9",
"npm-run-all2": "^7.0.1",
"prettier": "^3.3.3",
"typescript": "^5.5.4",
"typescript": "^5.6.3",
"typescript-eslint-parser-for-extra-files": "^0.7.0",
"vue-eslint-parser": "^9.4.3"
},
"dependencies": {
"@eslint/eslintrc": "^2.1.4",
"@eslint/js": "^8.57.0",
"@types/eslint": "^8.56.11",
"@eslint/eslintrc": "^3.1.0",
"@eslint/js": "^8.57.1",
"@types/eslint": "^8.56.12",
"chalk": "^4.1.2",
"debug": "^4.3.6",
"eslint": "^8.57.0",
"debug": "^4.3.7",
"eslint": "^8.57.1",
"execa": "^5.1.1",
"is-interactive": "^1.0.0",
"lodash": "^4.17.21",
"pkg-dir": "^5.0.0",
"radash": "^12.1.0",
"read-pkg": "^5.2.0",
"tslib": "^2.6.3",
"type-fest": "^4.24.0",
"tslib": "^2.8.1",
"type-fest": "^4.26.1",
"zod": "^3.23.8"
}
}
2 changes: 1 addition & 1 deletion src/components/extend.cts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const ExtendComponent = defineComponent('extend', () => {
return config
}

function extendConfigs(options?: Options | undefined, ...bases: string[]) {
function extendConfigs(options?: Options, ...bases: string[]) {
const parsed = Options.parse(options)
if (parsed.before != null) {
for (const base of parsed.before) {
Expand Down
2 changes: 1 addition & 1 deletion src/components/node.cts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const NodeComponent = defineComponent('node', ({ getComponent }) => {
}
}

function enable(options?: Options | undefined) {
function enable(options?: Options) {
getComponent(ExtendComponent).enable()

merge(settings, Options.parse(options))
Expand Down
21 changes: 12 additions & 9 deletions src/components/vue.cts
Original file line number Diff line number Diff line change
Expand Up @@ -50,22 +50,25 @@ export type Options = z.input<typeof Options>
/** Vue options schema. */
export const Options = Settings.partial().default({})

type BlockLanguageOptions<Blocks extends string = string> = {
[Block in Blocks]: {
type BlockLanguageOptions<Blocks extends string = string> = Record<
Blocks,
{
lang: string | string[]
allowNoLang?: boolean
}
}
>

const VueComponent = defineComponent('vue', ({ getComponent }) => {
const settings = Settings.parse({})

function getMarkupLangOptions(): BlockLanguageOptions<'template'> {
switch (settings.markup) {
case 'html':
default:
return { template: { lang: 'html', allowNoLang: true } }
}
// When adding support for other languages, the switch will be used.
return { template: { lang: 'html', allowNoLang: true } }
// switch (settings.markup) {
// case 'html':
// default:
// return { template: { lang: 'html', allowNoLang: true } }
// }
}

function getScriptLangOptions(): BlockLanguageOptions<'script'> {
Expand Down Expand Up @@ -163,7 +166,7 @@ const VueComponent = defineComponent('vue', ({ getComponent }) => {
}
}

function enable(options?: Options | undefined) {
function enable(options?: Options) {
getComponent(ExtendComponent).enable()

const theTypeScriptComponent = getComponent(TypeScriptComponent)
Expand Down
2 changes: 1 addition & 1 deletion src/core/logging.cts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const useConsole = shared(() =>
})
)

const useLogger = (writer?: LineWriter | undefined) => {
const useLogger = (writer?: LineWriter) => {
const stdio = useConsole()

return Object.freeze({
Expand Down
4 changes: 2 additions & 2 deletions src/core/propagation.cts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import useLegacyConfig from './legacy.cjs'
import type { Linter } from 'eslint'

export function isRuleOff(settings?: Linter.RuleEntry | null | undefined) {
export function isRuleOff(settings?: Linter.RuleEntry | null) {
return (
settings == null ||
settings === 0 ||
Expand All @@ -10,7 +10,7 @@ export function isRuleOff(settings?: Linter.RuleEntry | null | undefined) {
)
}

export function isRuleOn(settings?: Linter.RuleEntry | null | undefined) {
export function isRuleOn(settings?: Linter.RuleEntry | null) {
return !isRuleOff(settings)
}

Expand Down
2 changes: 1 addition & 1 deletion src/helpers/collections.cts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ type ReducePredicate<T, U> = (previousValue: U, currentValue: T, index: number,
export function reduceIterable<T>(iterable: Iterable<T>, predicate: ReducePredicate<T, T>): T
export function reduceIterable<T>(iterable: Iterable<T>, predicate: ReducePredicate<T, T>, intial: T): T
export function reduceIterable<T, U>(iterable: Iterable<T>, predicate: ReducePredicate<T, U>, initial: U): U
export function reduceIterable<T, U>(iterable: Iterable<T>, predicate: ReducePredicate<T, U>, initial?: U | undefined) {
export function reduceIterable<T, U>(iterable: Iterable<T>, predicate: ReducePredicate<T, U>, initial?: U) {
// eslint-disable-next-line @typescript-eslint/prefer-reduce-type-parameter -- Will not compile otherwise.
return Array.from(iterable).reduce(predicate, initial as U)
}
9 changes: 5 additions & 4 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
"extends": ["@tsconfig/strictest", "@tsconfig/node18"],
"include": ["src/**/*.ts", "src/**/*.cts", "src/**/*.mts", "prettier.config.d.cts"],
"compilerOptions": {
"incremental": true,
"checkJs": true,
"declaration": true,
"sourceMap": true,
"outDir": "./dist",
"importHelpers": true,
"incremental": true,
"isolatedModules": true,
"noEmitHelpers": true,
"noEmitOnError": true,
"isolatedModules": true
"outDir": "./dist",
"sourceMap": true
}
}

0 comments on commit 548ec66

Please sign in to comment.