@@ -3,22 +3,89 @@ module.exports = {
33 browser : true ,
44 es6 : true ,
55 } ,
6- extends : [ "plugin:react/recommended" , "airbnb" , "prettier" , "prettier/react" ] ,
6+ extends : [
7+ "plugin:react/recommended" ,
8+ "airbnb" ,
9+ "prettier" ,
10+ "prettier/@typescript-eslint" ,
11+ "prettier/react" ,
12+ ] ,
713 globals : {
814 Atomics : "readonly" ,
915 SharedArrayBuffer : "readonly" ,
16+ JSX : true ,
17+ "$" : true
1018 } ,
11- parser : "babel -eslint" ,
19+ parser : "@typescript -eslint/parser " ,
1220 parserOptions : {
1321 ecmaFeatures : {
1422 jsx : true ,
1523 } ,
16- ecmaVersion : 11 ,
24+ ecmaVersion : 2018 ,
1725 sourceType : "module" ,
1826 } ,
19- plugins : [ "react" , "prettier" ] ,
27+ plugins : [ "react" , "@typescript-eslint" , " prettier"] ,
2028 rules : {
21- camelcase : "warn" ,
22- "prettier/prettier" : "error" ,
29+ "react/destructuring-assignment" : "off" ,
30+ "react/prop-tyes" : "off" ,
31+ "react/jsx-filename-extension" : "off" ,
32+ "react/jsx-props-no-spreading" : "off" ,
33+ "react/no-did-update-set-state" : "off" ,
34+ "import/extensions" : "off" ,
35+ "no-unused-vars" : "off" ,
36+ camelcase : "off" ,
37+ "prettier/prettier" : "warn" ,
38+ "lines-between-class-members" : [
39+ "error" ,
40+ "always" ,
41+ { exceptAfterSingleLine : true } ,
42+ ] ,
43+ "jsx-a11y/label-has-associated-control" : [ 'error' , {
44+ "assert" :"either"
45+ } ] ,
46+ "react/static-property-placement" : [ "error" , "static public field" ] ,
47+ // We use console messages for some debugging, which is still required for now
48+ "no-console" : "off" ,
49+ // we use alert for some messages
50+ "no-alert" : "off" ,
51+ "no-restricted-globals" : "off" ,
52+ // Some files have private methods which start with _
53+ "no-underscore-dangle" : "off" ,
54+ // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-use-before-define.md#how-to-use
55+ "no-use-before-define" : "off" ,
56+ "@typescript-eslint/no-use-before-define" : [ "error" ] ,
57+ // We group multiple classes that implement a single functionality together
58+ "max-classes-per-file" : "off" ,
59+ // Table columns without a title
60+ "jsx-a11y/control-has-associated-label" : "off" ,
61+ // TODO: <a> tags without an href, until we add in proper routing
62+ "jsx-a11y/anchor-is-valid" : "off" ,
63+ "no-plusplus" : [ "error" , { "allowForLoopAfterthoughts" : true } ] ,
64+ // TODO: disable default on switch until we use enums
65+ "default-case" : "off"
2366 } ,
67+ settings : {
68+ "import/resolver" : {
69+ node : {
70+ extensions : [ ".js" , ".jsx" , ".ts" , ".tsx" ] ,
71+ } ,
72+ } ,
73+ } ,
74+ overrides : [
75+ {
76+ files : [ "**/*.test.js" , "**/*.test.ts" , "**/*.test.tsx" ] ,
77+ env : {
78+ jest : true ,
79+ } ,
80+ plugins : [ "jest" ] ,
81+ rules : {
82+ "import/no-extraneous-dependencies" : "off" ,
83+ "jest/no-disabled-tests" : "warn" ,
84+ "jest/no-focused-tests" : "error" ,
85+ "jest/no-identical-title" : "error" ,
86+ "jest/prefer-to-have-length" : "warn" ,
87+ "jest/valid-expect" : "error" ,
88+ } ,
89+ } ,
90+ ] ,
2491} ;
0 commit comments