0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-24 18:07:17 +01:00
posthog/.eslintrc.js
Marius Andra a256373526
Add Typescript Support (#1157)
* explicitly ignore some linting errors

* add typescript support and fix postcss dev warnings

* convert a few files to ".ts"

* fix return values
2020-07-08 09:45:23 +02:00

60 lines
1.6 KiB
JavaScript

/* eslint-disable @typescript-eslint/no-var-requires */
/* global module */
module.exports = {
env: {
browser: true,
es6: true,
'cypress/globals': true,
},
settings: {
react: {
version: 'detect',
},
},
extends: [
'plugin:@typescript-eslint/recommended',
'eslint:recommended',
'plugin:react/recommended',
'prettier/@typescript-eslint',
],
globals: {
Atomics: 'readonly',
SharedArrayBuffer: 'readonly',
},
parser: 'babel-eslint',
parserOptions: {
project: './tsconfig.json',
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 2018,
sourceType: 'module',
},
plugins: ['prettier', 'react', 'cypress', '@typescript-eslint'],
rules: {
'react/prop-types': [0],
'react/no-unescaped-entities': [0],
'no-unused-vars': ['error', { ignoreRestSiblings: true }],
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-empty-function': 'off',
},
overrides: [
{
// enable the rule specifically for TypeScript files
files: ['*.ts', '*.tsx'],
rules: {
'@typescript-eslint/explicit-function-return-type': ['error'],
'@typescript-eslint/explicit-module-boundary-types': ['error'],
},
},
{
files: ['*.js'],
rules: {
'typescript/no-var-requires': 'off',
},
},
],
}