git.fiddlerwoaroof.com
Browse code

chore: getting things working

Ed L authored on 14/06/2020 22:00:31
Showing 8 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,38 @@
1
+module.exports = {
2
+    "env": {
3
+        "browser": true,
4
+        "es2020": true
5
+    },
6
+    "extends": [
7
+        "eslint:recommended",
8
+        "plugin:react/recommended"
9
+    ],
10
+    "parserOptions": {
11
+        "ecmaFeatures": {
12
+            "jsx": true
13
+        },
14
+        "ecmaVersion": 11,
15
+        "sourceType": "module"
16
+    },
17
+    "plugins": [
18
+        "react"
19
+    ],
20
+    "rules": {
21
+        "indent": [
22
+            "error",
23
+            4
24
+        ],
25
+        "linebreak-style": [
26
+            "error",
27
+            "unix"
28
+        ],
29
+        "quotes": [
30
+            "error",
31
+            "double"
32
+        ],
33
+        "semi": [
34
+            "error",
35
+            "always"
36
+        ]
37
+    }
38
+};
0 39
new file mode 100644
... ...
@@ -0,0 +1,4 @@
1
+*~
2
+jsconfig.json
3
+.eslintrc.js
4
+result
1 6
new file mode 100644
... ...
@@ -0,0 +1,12 @@
1
+!doctype html>
2
+<html lang="en">
3
+  <head>
4
+    <meta charset="UTF-8" />
5
+    <title>Document</title>
6
+  </head>
7
+  <body>
8
+    <script type="module">
9
+      import "src/index.js";
10
+    </script>
11
+  </body>
12
+</html>
0 13
new file mode 100644
... ...
@@ -0,0 +1,78 @@
1
+let CO =
2
+      { Target =
3
+          < es3
4
+          | es5
5
+          | es6
6
+          | es2015
7
+          | es2016
8
+          | es2017
9
+          | es2018
10
+          | es2019
11
+          | es2020
12
+          | esnext
13
+          >
14
+      , JSX = < preserve | react | react-native >
15
+      , Module =
16
+          < commonJS
17
+          | amd
18
+          | umd
19
+          | system
20
+          | es6
21
+          | es2015
22
+          | es2020
23
+          | esnext
24
+          | none
25
+          >
26
+      , Lib =
27
+          < es5
28
+          | es6
29
+          | es7
30
+          | es2015
31
+          | es2016
32
+          | es2017
33
+          | es2018
34
+          | es2019
35
+          | es2020
36
+          | esnext
37
+          | dom
38
+          | scripthost
39
+          | webworker
40
+          >
41
+      }
42
+
43
+let JSConfigType =
44
+      { compilerOptions :
45
+          { target : CO.Target
46
+          , jsx : CO.JSX
47
+          , module : CO.Module
48
+          , baseUrl : Text
49
+          , allowSyntheticDefaultImports : Bool
50
+          , noEmit : Bool
51
+          , lib : List CO.Lib
52
+          , rootDirs : List Text
53
+          }
54
+      , exclude : List Text
55
+      }
56
+
57
+let JSConfig =
58
+      { Type = JSConfigType
59
+      , default =
60
+          { compilerOptions =
61
+              { target = CO.Target.es6
62
+              , jsx = CO.JSX.preserve
63
+              , module = CO.Module.es6
64
+              , baseUrl = "src"
65
+              , allowSyntheticDefaultImports = False
66
+              , noEmit = True
67
+              , rootDirs = [ "src" ]
68
+              , lib = [ CO.Lib.dom ]
69
+              }
70
+          , exclude = [ "node_modules" ]
71
+          }
72
+      }
73
+
74
+in  JSConfig::{
75
+    , compilerOptions = JSConfig.default.compilerOptions::{
76
+      , rootDirs = [ "src" ]
77
+      }
78
+    }
... ...
@@ -5,6 +5,7 @@
5 5
   "sourceType": "module",
6 6
   "main": "src/index.js",
7 7
   "scripts": {
8
+    "setup-env": "bash setup.sh",
8 9
     "test": "echo \"Error: no test specified\" && exit 1"
9 10
   },
10 11
   "keywords": [],
... ...
@@ -18,6 +19,7 @@
18 19
     "routedux": "^1.0.4"
19 20
   },
20 21
   "devDependencies": {
21
-    "eslint": "7.2.0"
22
+    "eslint": "7.2.0",
23
+    "eslint-plugin-react": "7.20.0"
22 24
   }
23 25
 }
24 26
new file mode 100644
... ...
@@ -0,0 +1,3 @@
1
+#!/usr/bin/env bash
2
+
3
+dhall-to-json --pretty < jsconfig.dhall > jsconfig.json
0 4
new file mode 100644
... ...
@@ -0,0 +1 @@
1
+import * as R from "ramda";