Skip to content

Commit

Permalink
[Meta] Set up formatter & linter
Browse files Browse the repository at this point in the history
  • Loading branch information
lexisother committed Jun 12, 2024
1 parent b45ce24 commit dba33b4
Show file tree
Hide file tree
Showing 4 changed files with 1,294 additions and 6 deletions.
37 changes: 37 additions & 0 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
extends: eslint-config-dmitmel/presets/node
env:
browser: true

rules:
node/no-unsupported-features/es-syntax:
- error
- ignores:
- modules
- dynamicImport

overrides:
- files: '**/*.ts'
extends:
- eslint-config-dmitmel/presets/typescript-addon
# - eslint-config-dmitmel/presets/typescript-with-type-checking-addon
parserOptions:
project: 'tsconfig.json'

- files: '**/*.d.ts'
rules:
'@typescript-eslint/no-empty-interface': off
'@typescript-eslint/no-explicit-any':
- warn
- ignoreRestArgs: true

# everything in declarations is public anyway
'@typescript-eslint/explicit-member-accessibility':
- warn
- accessibility: no-public

node/no-missing-import: off
node/no-extraneous-import: off

# See <https://github.com/typescript-eslint/typescript-eslint/pull/2902>
# and <https://github.com/typescript-eslint/typescript-eslint/pull/2902>
'@typescript-eslint/no-unused-vars': off
12 changes: 6 additions & 6 deletions base-class-system.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ declare global {
K extends keyof Prototype,
Constructor,
Prototype,
ParentPrototype
ParentPrototype,
> = K extends keyof ParentPrototype
? Prototype & { constructor: Constructor; parent: ParentPrototype }
: Prototype & { constructor: Constructor };
Expand All @@ -29,7 +29,7 @@ declare global {
Key extends keyof Prototype,
Constructor,
Prototype,
ParentPrototype
ParentPrototype,
> = ReplaceThisParameter<
Prototype[Key],
ClassMethodThis<Key, Constructor, Prototype, ParentPrototype>
Expand All @@ -46,7 +46,7 @@ declare global {

type ClassStaticMember<
Key extends keyof Prototype,
Prototype
Prototype,
> = Prototype[Key] extends (
this: infer This,
...args: infer Args
Expand Down Expand Up @@ -79,10 +79,10 @@ declare global {
this: this,
instanceDefinition: ClassDefinition<
ChildConstructor,
ChildConstructor["prototype"],
this["prototype"]
ChildConstructor['prototype'],
this['prototype']
>,
staticDefinition: ClassStaticDefinition<ChildConstructor["prototype"]>
staticDefinition: ClassStaticDefinition<ChildConstructor['prototype']>,
): ChildConstructor;
readonly prototype: ClassPrototype<this, Instance, Static>;
}
Expand Down
7 changes: 7 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@
"author": "Alyxia Sother <alyxia@riseup.net>",
"license": "MIT",
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^7.13.0",
"@typescript-eslint/parser": "^7.13.0",
"eslint": "^8.57.0",
"eslint-config-dmitmel": "github:dmitmel/eslint-config-dmitmel",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^5.1.3",
"prettier": "^3.3.2",
"typescript": "^5.4.5"
},
"scripts": {
Expand Down
Loading

0 comments on commit dba33b4

Please sign in to comment.