Skip to content

Common ESLint configuration used in Hamster

License

Notifications You must be signed in to change notification settings

AwesomeHamster/eslint-config

Folders and files

NameName
Last commit message
Last commit date

Latest commit

9025c21 · Jan 2, 2025

History

93 Commits
Jan 2, 2025
Jan 2, 2025
Jul 5, 2024
Nov 8, 2024
Nov 9, 2024
Jan 2, 2025
Aug 6, 2024
Jan 2, 2025
Jan 2, 2025
Aug 1, 2024
Jun 4, 2024
Jun 4, 2024
Jan 2, 2025

Repository files navigation

@hamster-bot/eslint-config

Common ESLint configuration used in Hamster

Install

npm i --save-dev eslint @hamster-bot/eslint-config
# Or use yarn
yarn add --dev eslint @hamster-bot/eslint-config

Usage

This package provides flat config introduced in ESLint v9.

Create an eslint configuration file like eslint.config.mjs and append the following:

import * as hamster from '@hamster-bot/eslint-config'

export default [
  ...hamster.configs.base,
  // Add more configurations here
]

For example, for ESLint Mocha plugin:

import * as hamster from '@hamster-bot/eslint-config'
import mochaPlugin from 'eslint-plugin-mocha'

export default [
  ...hamster.configs.base,
  mochaPlugin.configs.flat.recommended,
]

You can also use require() and module.export if you are using CommonJS. In that case, you should use .cjs extension or just .js for the configuration file.


TypeScript user should use hamster.configs.typescript:

import * as hamster from '@hamster-bot/eslint-config'

export default [
  ...hamster.configs.typescript,
  // Add more configurations here
]

We also provide a configuration for Node scripts:

import * as hamster from '@hamster-bot/eslint-config'

export default [
  ...hamster.configs.node,
  // Add more configurations here
]

License

Creative Commons License

This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.