Skip to content

Instantly share code, notes, and snippets.

@lynnkwong
Created October 13, 2022 23:14
Show Gist options
  • Save lynnkwong/8dfe47b0a61c2243300bc84f921142c4 to your computer and use it in GitHub Desktop.
Save lynnkwong/8dfe47b0a61c2243300bc84f921142c4 to your computer and use it in GitHub Desktop.
module.exports = {
env: {
browser: true,
es2021: true,
},
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:import/recommended",
"plugin:import/typescript",
],
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaVersion: "latest",
sourceType: "module",
tsconfigRootDir: __dirname,
project: ["./tsconfig.json"],
},
plugins: ["@typescript-eslint", "prettier"],
ignorePatterns: [".eslintrc.js"],
rules: {
"no-console": "error",
"sort-imports": [
"error",
{
ignoreCase: false,
ignoreDeclarationSort: true,
ignoreMemberSort: false,
memberSyntaxSortOrder: ["none", "all", "multiple", "single"],
allowSeparatedGroups: true,
},
],
"import/no-unresolved": "error",
"import/order": [
"error",
{
groups: [
"builtin",
"external",
"internal",
"parent",
"sibling",
"index",
"object",
"type",
],
"newlines-between": "always",
alphabetize: {
order: "asc",
caseInsensitive: true,
},
},
],
},
settings: {
"import/resolver": {
typescript: {
project: "./tsconfig.json",
},
},
},
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment