0.3.1 • Published 1 month ago

eslint-config-coralloy v0.3.1

Weekly downloads
-
License
MIT
Repository
-
Last release
1 month ago

eslint-config-coralloy

Installation

pnpm i -D eslint-config-coralloy

// .eslintrc.js

module.exports = {
  extends: ["coralloy", "coralloy/vue-i18n"],
};
{
  rules: {
    "vue/no-unsupported-features": [
        "error",
        { version: require("vue").version },
      ],
  }
}

Migration from 0.1.x

You can now remove

{
  parserOptions: {
    // https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/parser#parseroptionstsconfigrootdir
    tsconfigRootDir: __dirname,
  },
}

as we now use project: true (https://typescript-eslint.io/packages/parser/#project) to autodetect the correct tsconfig file. tsconfigRootDir won't have any effect under the new setup, so removing it is just for the sake of clean code.

Dev notes

parserOptions.project will search for a tsconfig into the same folder as the eslint config file, since we suppose linting will be managed at root level and only one tsconfig will be present. It can be overridden in userland if needed to point to a different tsconfig.

We decided to go for eslint-config-coralloy instead of @coralloy/eslint-config due to consistency of the name to use when exporting multiple configs. Using eslint-config-coralloy the base can be included using coralloy and additional ones with coralloy/something. Using scoped modules would force to use the expanded form of @coralloy/eslint-config/something when using a config different than the default one, but only @coralloy for basic config.