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

Upgrade deps #259

Merged
merged 5 commits into from
Feb 2, 2025
Merged
Show file tree
Hide file tree
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
20 changes: 11 additions & 9 deletions eslint.config.js → eslint.config.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
import assert from 'node:assert';

import eslintJs from '@eslint/js';
import type { ESLint, Linter } from 'eslint';
import stylistic from '@stylistic/eslint-plugin';
import prettierConfig from 'eslint-config-prettier';
import * as regexpPlugin from 'eslint-plugin-regexp';
import globals from 'globals';
import pkgJson from './package.json' with { type: 'json' };

const defaultSourceType =
/** @type {import('eslint').Linter.SourceType | undefined} */ (
pkgJson.type
) ?? 'commonjs';
const defaultSourceType: Linter.SourceType = 'module';
assert(pkgJson.type === defaultSourceType);

/** @satisfies {import('eslint').Linter.Config[]} */
export default [
const configs = [
eslintJs.configs.recommended,
prettierConfig,
regexpPlugin.configs['flat/recommended'],

{
plugins: {
'@stylistic': stylistic
// Cast needed due to type mismatch even though this is the recommmended way to use the plugin.
'@stylistic': stylistic as ESLint.Plugin
},

linterOptions: {
Expand Down Expand Up @@ -61,7 +62,6 @@ export default [

// @stylistic rules - needed as prettier doesn't handle these
'@stylistic/quotes': ['error', 'single', { avoidEscape: true }],
'@stylistic/object-curly-spacing': ['error', 'always'],

/* eslint-plugin-regexp */
'regexp/prefer-character-class': ['error', { minAlternatives: 2 }],
Expand Down Expand Up @@ -103,4 +103,6 @@ export default [
// `ignores` field must be in the very bottom config.
ignores: ['dist/**/*', '**/*-polyfill.*']
}
];
] as const satisfies Linter.Config[];

export default configs;
2 changes: 1 addition & 1 deletion lint-staged.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ function globForCode(/** @type {string} */ toolName) {
return '*.?(c|m){js,ts}?(x)' + `*(${toolName})`;
}

/** @type {import('lint-staged').Config} */
/** @type {import('lint-staged').Configuration} */
export default {
'*': 'prettier --ignore-unknown --write',
[globForCode('eslint')]: 'eslint',
Expand Down
Loading