0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-28 09:16:49 +01:00
posthog/.eslintrc.js
Marius Andra 5d1bae4b8f
chore(upgrade): Kea 3.0, keeping React at 16.11 (#9682)
* upgrade to 2.6

* upgrade kea-forms, validator -> errors

* upgrade to 3.0

* fix some kea 3.0 changes

* default forms to submit

* fix some issues

* newer typegen and router

* new subscriptions plugin

* upgrade packages, replace subscriptionsPlugin

* convert all logic that used forms to kea 3

* bump babel, remove babel-plugin-kea

* fix circluar TS import bug

* fix few tests

* fix more tests

* convert to use new subscriptions

* fix more tests

* convert to v3 to use new subscriptions

* remove packages

* remove unused provider tag

* fix props order

* connect prompts

* misc type additions

* upgrade kea

* clean up few more tests from noise
2022-05-09 11:34:28 +02:00

107 lines
3.0 KiB
JavaScript

/* eslint-disable @typescript-eslint/no-var-requires */
/* global module */
module.exports = {
ignorePatterns: ['node_modules', 'plugin-server'],
env: {
browser: true,
es6: true,
'cypress/globals': true,
},
settings: {
react: {
version: 'detect',
},
},
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:react/recommended',
'prettier',
'plugin:storybook/recommended',
],
globals: {
Atomics: 'readonly',
SharedArrayBuffer: 'readonly',
},
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 2018,
sourceType: 'module',
},
plugins: ['prettier', 'react', 'cypress', '@typescript-eslint'],
rules: {
'react/prop-types': [0],
'react/no-unescaped-entities': [0],
'react/jsx-no-target-blank': [0],
'react/self-closing-comp': [
'error',
{
component: true,
html: true,
},
],
'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',
'@typescript-eslint/no-inferrable-types': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-non-null-assertion': 'error',
curly: 'error',
'no-restricted-imports': [
'error',
{
paths: [
{
name: 'dayjs',
message: 'Do not directly import dayjs. Only import the dayjs exported from lib/dayjs.',
},
],
},
],
},
overrides: [
{
// enable the rule specifically for TypeScript files
files: ['*Type.ts', '*Type.tsx'],
rules: {
'@typescript-eslint/no-explicit-any': ['off'],
'@typescript-eslint/ban-types': ['off'],
},
},
{
// enable the rule specifically for TypeScript files
files: ['*.ts', '*.tsx'],
rules: {
'@typescript-eslint/no-explicit-any': ['off'],
'@typescript-eslint/explicit-function-return-type': [
'error',
{
allowExpressions: true,
},
],
'@typescript-eslint/explicit-module-boundary-types': [
'error',
{
allowArgumentsExplicitlyTypedAsAny: true,
},
],
},
},
{
files: ['*.js'],
rules: {
'@typescript-eslint/no-var-requires': 'off',
},
},
],
}