Skip to content

Commit

Permalink
feat: rewrite
Browse files Browse the repository at this point in the history
declaring branch bankruptcy.  everything except docs is going in here, and when it passes, it's getting merged
  • Loading branch information
boneskull committed Sep 2, 2024
1 parent 6004860 commit bee12cb
Show file tree
Hide file tree
Showing 608 changed files with 48,975 additions and 12,565 deletions.
4 changes: 2 additions & 2 deletions .config/dependency-cruiser.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module.exports = {
forbidden: [
{
name: 'no-circular',
severity: 'warn',
severity: 'error',
comment:
'This dependency is part of a circular relationship. You might want to revise ' +
'your solution (i.e. use dependency inversion, make sure the modules have a single responsibility) ',
Expand Down Expand Up @@ -131,7 +131,7 @@ module.exports = {
severity: 'error',
from: {},
to: {
path: '.spec.ts$',
path: '\\.spec\\.ts$',
},
},
{
Expand Down
9 changes: 9 additions & 0 deletions .config/tsconfig.src.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": "./tsconfig.workspace.json",
"compilerOptions": {
"declaration": true,
"declarationMap": true,
"sourceMap": true,
"stripInternal": true
}
}
7 changes: 7 additions & 0 deletions .config/tsconfig.test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "./tsconfig.workspace.json",
"compilerOptions": {
"types": ["node", "mocha"],
"noEmit": true
}
}
11 changes: 11 additions & 0 deletions .config/tsconfig.workspace.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"extends": "@tsconfig/node18/tsconfig.json",
"compilerOptions": {
"types": ["node"],
"composite": true,
"customConditions": ["typedoc"],
"resolveJsonModule": true,
"resolvePackageJsonImports": true,
"noImplicitOverride": true
}
}
4 changes: 4 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@ dist
__snapshots__
**/*.tpl
**/fixture/**/*
docs/api/
example/
**/.astro/**/*
env.d.ts
246 changes: 246 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,246 @@
/**
* @type {import('eslint').Linter.Config}
*/
module.exports = {
env: {
es2020: true,
node: true,
},
extends: [
'eslint:recommended',
'plugin:n/recommended',
'plugin:perfectionist/recommended-natural-legacy',
],
ignorePatterns: [
'node_modules',
'coverage',
'dist',
'__snapshots__',
'*.tpl',
'fixture',
'docs/api',
'example',
'.astro',
'env.d.ts',
],
overrides: [
// JS overrides
{
files: ['**/*.js', '**/*.mjs', '**/*.cjs'],
overrides: [
{
files: '**/*.mjs',
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
},
rules: {
'n/no-unsupported-features/es-syntax': 'off',
},
},
],
rules: {
'@stylistic/js/lines-around-comment': [
'warn',
{
allowClassStart: true,
// these conflict with prettier, so we must allow them
allowObjectStart: true,
beforeBlockComment: true,
},
],
'@stylistic/js/semi': ['error', 'always'],
},
},

// TS overrides
{
extends: ['plugin:@typescript-eslint/strict-type-checked'],
files: '**/*.ts',
overrides: [
{
env: {
mocha: true,
},
files: ['**/test/**/*.ts'],
overrides: [
{
extends: ['plugin:mocha/recommended'],
files: ['**/test/**/*.spec.ts'],
rules: {
// conflicts with xstate's setup
'mocha/no-nested-tests': 'off',
// also
'mocha/no-setup-in-describe': 'off',
},
},
],
rules: {
'@typescript-eslint/no-unsafe-argument': 'off',
// mostly due to untyped unexpected assertion lib
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-return': 'off',

// using requires w/ rewiremock
'@typescript-eslint/no-var-requires': 'off',

// conflicts with sinon
'@typescript-eslint/unbound-method': 'off',
},
},
],

parser: '@typescript-eslint/parser',
parserOptions: {
project: true,
tsconfigRootDir: __dirname,
},
rules: {
'@stylistic/ts/lines-around-comment': [
'warn',
{
allowArrayStart: true,
allowBlockStart: true,
allowClassStart: true,
allowInterfaceStart: true,
// these conflict with prettier, so we must allow them
allowObjectStart: true,
allowTypeStart: true,
beforeBlockComment: true,
},
],

'@stylistic/ts/lines-between-class-members': 'error',

'@stylistic/ts/padding-line-between-statements': [
'error',
{blankLine: 'always', next: 'export', prev: '*'},
],

'@stylistic/ts/semi': ['error', 'always'],

'@typescript-eslint/consistent-type-exports': [
'error',
{fixMixedExportsWithInlineTypeSpecifier: true},
],

'@typescript-eslint/consistent-type-imports': [
'error',
{
disallowTypeAnnotations: true,
fixStyle: 'inline-type-imports',
prefer: 'type-imports',
},
],

// and sometimes you gotta use any
'@typescript-eslint/no-explicit-any': 'off',
// this rule seems broken
'@typescript-eslint/no-invalid-void-type': 'off',
// HATE IT
'@typescript-eslint/no-non-null-assertion': 'off',

// node's util.inspect() seems to be either nondeterministic across platforms,
// which makes it difficult to take snapshots of its output
'@typescript-eslint/no-restricted-imports': [
'warn',
{
paths: [
{
importNames: ['inspect'],
message: 'Use stringify-object package if possible',
name: 'util',
},
{
importNames: ['inspect'],
message: 'Use stringify-object package if possible',
name: 'node:util',
},
],
},
],

'@typescript-eslint/no-unnecessary-boolean-literal-compare': [
'error',
{
allowComparingNullableBooleansToFalse: true,
allowComparingNullableBooleansToTrue: true,
},
],

// too many false positives
'@typescript-eslint/no-unnecessary-condition': 'off',

'@typescript-eslint/no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
},
],

// these 6 bytes add up
'@typescript-eslint/require-await': 'off',

// I like my template expressions, tyvm
'@typescript-eslint/restrict-template-expressions': 'off',

'@typescript-eslint/switch-exhaustiveness-check': 'error',

'@typescript-eslint/unified-signatures': [
'error',
{
ignoreDifferentlyNamedParameters: true,
},
],

'no-use-before-define': 'off',

'perfectionist/sort-named-exports': [
'error',
{groupKind: 'values-first'},
],
},
},

// JSON5 overrides
{
extends: ['plugin:jsonc/prettier'],
files: ['**/tsconfig*.json', '**/*.json5', '**/*.jsonc'],
},

// script overrides
{
files: ['**/scripts/**/*'],
rules: {
'n/shebang': 'off',
},
},
],
parserOptions: {
sourceType: 'script',
},
plugins: ['@stylistic/ts', '@stylistic/js'],
root: true,
rules: {
'n/no-extraneous-import': 'off',
'n/no-extraneous-require': 'off',
'n/no-missing-import': 'off',
'n/no-missing-require': 'off',
// either eslint-plugin-n's module resolution is busted or it's too confusing to configure properly
'n/no-unpublished-bin': 'off',
'n/no-unsupported-features/es-syntax': 'off',
'no-empty': [
'error',
{
allowEmptyCatch: true,
},
],

'no-useless-rename': 'error',

'object-shorthand': 'error',
},
};
30 changes: 0 additions & 30 deletions .eslintrc.yml

This file was deleted.

63 changes: 63 additions & 0 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{
$schema: 'https://docs.renovatebot.com/renovate-schema.json',
extends: [
'config:recommended',
'group:definitelyTyped',
'workarounds:typesNodeVersioning',
':automergePatch',
':automergeDigest',
':enableVulnerabilityAlerts',
':rebaseStalePrs',
':semanticCommits',
':semanticPrefixChore',
],
packageRules: [
{
matchPackageNames: [
'@types/wrap-ansi',
'chalk',
'conf',
'del',
'delay',
'env-paths',
'execa',
'figures',
'find-up',
'get-port',
'get-stream',
'globby',
'got',
'inquirer',
'log-symbols',
'ora',
'p-retry',
'pkg-dir',
'read-pkg',
'strip-ansi',
'supports-color',
'term-size',
'terminal-link',
'vinyl-paths',
'wrap-ansi',
'write-pkg',
],
matchUpdateTypes: ['major'],
enabled: false,
},
{
matchPackageNames: ['typescript'],
automerge: false,
},
{
extends: ['packages:eslint'],
groupName: 'ESLint-related packages',
groupSlug: 'eslint',
},
{
extends: ['monorepo:typescript-eslint'],
groupName: 'TypoeScript-related packages',
matchPackageNames: ['typescript', 'ts-node'],
},
],
transitiveRemediation: true,
}
Loading

0 comments on commit bee12cb

Please sign in to comment.