1.4.0 • Published 1 year ago

@typed-sigterm/eslint-config v1.4.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Typed SIGTERM's ESLint Config

npm code style

Correct example:

import process from 'node:process';

class YeWenjie {
  public think() {
    return new Promise<unknown>((resolve) => {
      if (globalThis.world)
        console.error('Why the world is defined?');
      else
        console.error('Why the world is undefined?');
      setTimeout(() => resolve(41), 114514);
    });
  }
}

const yeWenjie = new YeWenjie();

if (await yeWenjie.think() === 41) {
  console.error('Physics no longer exists!');
  process.exit(1);
} else {
  process.exit(0);
}

Usage

Install the dependency in your project:

# @antfu/eslint-config is a peer dependency, so manually installing is required
pnpm add -D @typed-sigterm/eslint-config @antfu/eslint-config

And create eslint.config.mjs in your project root:

import ts from '@typed-sigterm/eslint-config';

export default ts();

Add script for package.json:

{
  "scripts": {
    "lint": "eslint ."
  }
}

Now you can run pnpm lint to lint your code.

VS Code support (auto fix on save)

See documentation of @antfu/eslint-config.

Credits

The project is only a wrapper/modifier of @antfu/eslint-config. Thanks to Anthony Fu for the great work!

1.4.0

1 year ago

1.2.0

2 years ago

1.3.0

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago