@kayahr/eslint-config

3.5.0 • Public • Published

kayahr eslint config

Shared eslint configuration for my personal TypeScript projects.

How to use it in a project

  • Install the dependencies:

    $ npm install -DE @kayahr/eslint-config
  • Create an eslint.config.js (Or eslint.config.mjs in CommonJS projects) configuration file with the following content (Modify environment if necessary):

    {
        import kayahrConfigs from "@kayahr/eslint-config";
        import globals from "globals";
    
        export default [
            {
                ignores: [
                    "doc",
                    "lib"
                ]
            },
            {
                languageOptions: {
                    globals: {
                        ...globals.browser,
                        ...globals.node
                    }
                }
            },
            {
                files: [ "**/*.js" ],
                languageOptions: {
                    sourceType: "commonjs"
                }
            },
            ...kayahrConfigs
        ];
    }

    The block with sourceType: "commonjs" is only needed for CommonJS projects.

  • Add the following script line to package.json:

    "lint": "eslint --max-warnings 0"
  • Reference the lint script in the test script:

    "test": "npm run -s lint && npm run -s check"
  • Run eslint by typing npm test or npm run lint.

Readme

Keywords

none

Package Sidebar

Install

npm i @kayahr/eslint-config

Weekly Downloads

22

Version

3.5.0

License

MIT

Unpacked Size

116 kB

Total Files

27

Last publish

Collaborators

  • kayahr