Skip to content

Instantly share code, notes, and snippets.

@lynnkwong
Last active August 12, 2022 17:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lynnkwong/a3300c1b8e0a38348a619bfafcb6812d to your computer and use it in GitHub Desktop.
Save lynnkwong/a3300c1b8e0a38348a619bfafcb6812d to your computer and use it in GitHub Desktop.
module.exports = {
env: {
browser: true,
es2021: true
},
extends: [
'standard',
'eslint:recommended',
],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
},
plugins: [
'@typescript-eslint' // For TypeScript.
],
overrides: [ // Use `overrides` so ESLint can check both JS and TS files.
{
files: ['*.ts', '*.tsx'],
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
],
parserOptions: {
tsconfigRootDir: __dirname,
project: ['./tsconfig.json'],
},
},
],
ignorePatterns: ['.eslintrc.js'],
rules: {
quotes: ["error", "double"], // Use double quotes.
semi: ["error", "always"], // Always add a semicolon at the end statements.
indent: ["error", 2], // Indentation is two spaces.
"no-console": "error" // Avoid using methods on `console` in the code.
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment