elm-pages 3.0.0-beta.0 → 3.0.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/codegen/elm-pages-codegen.js +38516 -0
  2. package/generator/dead-code-review/elm-stuff/tests-0.19.1/elm-stuff/0.19.1/Pages-Review-DeadCodeEliminateData.elmi +0 -0
  3. package/generator/dead-code-review/elm-stuff/tests-0.19.1/elm-stuff/0.19.1/Pages-Review-DeadCodeEliminateData.elmo +0 -0
  4. package/generator/dead-code-review/elm-stuff/tests-0.19.1/elm-stuff/0.19.1/Pages-Review-DeadCodeEliminateDataTest.elmi +0 -0
  5. package/generator/dead-code-review/elm-stuff/tests-0.19.1/elm-stuff/0.19.1/Pages-Review-DeadCodeEliminateDataTest.elmo +0 -0
  6. package/generator/dead-code-review/elm-stuff/tests-0.19.1/elm-stuff/0.19.1/Reporter.elmi +0 -0
  7. package/generator/dead-code-review/elm-stuff/tests-0.19.1/elm-stuff/0.19.1/Reporter.elmo +0 -0
  8. package/generator/dead-code-review/elm-stuff/tests-0.19.1/elm-stuff/0.19.1/Runner.elmi +0 -0
  9. package/generator/dead-code-review/elm-stuff/tests-0.19.1/elm-stuff/0.19.1/Runner.elmo +0 -0
  10. package/generator/dead-code-review/elm-stuff/tests-0.19.1/elm-stuff/0.19.1/d.dat +0 -0
  11. package/generator/dead-code-review/elm-stuff/tests-0.19.1/elm-stuff/0.19.1/i.dat +0 -0
  12. package/generator/dead-code-review/elm-stuff/tests-0.19.1/elm-stuff/0.19.1/lock +0 -0
  13. package/generator/dead-code-review/elm-stuff/tests-0.19.1/elm-stuff/0.19.1/o.dat +0 -0
  14. package/generator/dead-code-review/elm-stuff/tests-0.19.1/elm.json +1 -0
  15. package/generator/dead-code-review/elm-stuff/tests-0.19.1/js/Reporter.elm.js +6795 -0
  16. package/generator/dead-code-review/elm-stuff/tests-0.19.1/js/Runner.elm.js +25651 -0
  17. package/generator/dead-code-review/elm-stuff/tests-0.19.1/js/node_runner.js +110 -0
  18. package/generator/dead-code-review/elm-stuff/tests-0.19.1/js/node_supervisor.js +187 -0
  19. package/generator/dead-code-review/elm-stuff/tests-0.19.1/js/package.json +1 -0
  20. package/generator/dead-code-review/elm-stuff/tests-0.19.1/src/Reporter.elm +26 -0
  21. package/generator/dead-code-review/elm-stuff/tests-0.19.1/src/Runner.elm +62 -0
  22. package/generator/dead-code-review/elm.json +35 -0
  23. package/generator/dead-code-review/src/Pages/Review/DeadCodeEliminateData.elm +181 -0
  24. package/generator/dead-code-review/src/ReviewConfig.elm +9 -0
  25. package/generator/dead-code-review/tests/Pages/Review/DeadCodeEliminateDataTest.elm +455 -0
  26. package/generator/review/elm-stuff/tests-0.19.1/elm-stuff/0.19.1/d.dat +0 -0
  27. package/generator/review/elm-stuff/tests-0.19.1/js/node_runner.js +1 -1
  28. package/generator/review/elm-stuff/tests-0.19.1/js/node_supervisor.js +1 -1
  29. package/generator/src/SharedTemplate.elm +1 -1
  30. package/generator/src/generate-template-module-connector.js +2 -22
  31. package/package.json +5 -2
  32. package/src/DataSource/File.elm +1 -1
  33. package/src/DataSource/Internal/Request.elm +0 -5
  34. package/src/Form.elm +1 -1
  35. package/src/Head/Seo.elm +16 -27
  36. package/src/Pages/Internal/NotFoundReason.elm +3 -2
  37. package/src/Pages/Internal/Platform/Cli.elm +13 -8
  38. package/src/Pages/Internal/Platform.elm +3 -3
  39. package/src/Pages/ProgramConfig.elm +1 -1
@@ -0,0 +1,110 @@
1
+ const { parentPort } = require("worker_threads");
2
+ const { performance } = require("perf_hooks");
3
+
4
+ // From templates/polyfills.js
5
+ // Apply Node polyfills as necessary.
6
+ var window = {
7
+ Date: Date,
8
+ addEventListener: function () {},
9
+ removeEventListener: function () {},
10
+ };
11
+
12
+ var location = {
13
+ href: "",
14
+ host: "",
15
+ hostname: "",
16
+ protocol: "",
17
+ origin: "",
18
+ port: "",
19
+ pathname: "",
20
+ search: "",
21
+ hash: "",
22
+ username: "",
23
+ password: "",
24
+ };
25
+
26
+ var document = {
27
+ body: {},
28
+ createTextNode: function () {},
29
+ location: location,
30
+ };
31
+
32
+ var oldConsoleWarn = console.warn;
33
+ console.warn = function () {
34
+ if (
35
+ arguments.length === 1 &&
36
+ arguments[0].indexOf("Compiled in DEV mode") === 0
37
+ )
38
+ return;
39
+ return oldConsoleWarn.apply(console, arguments);
40
+ };
41
+
42
+ if (typeof FileList === "undefined") {
43
+ var FileList = function () {};
44
+ }
45
+
46
+ if (typeof File === "undefined") {
47
+ var File = function () {};
48
+ }
49
+
50
+ if (typeof XMLHttpRequest === "undefined") {
51
+ var XMLHttpRequest = function () {
52
+ return {
53
+ addEventListener: function () {},
54
+ open: function () {},
55
+ send: function () {},
56
+ };
57
+ };
58
+ }
59
+
60
+ if (typeof FormData === "undefined") {
61
+ var FormData = function () {
62
+ this._data = [];
63
+ };
64
+ FormData.prototype.append = function () {
65
+ this._data.push(Array.prototype.slice.call(arguments));
66
+ };
67
+ }
68
+
69
+
70
+ // Capture Debug.log from elm code
71
+ let logs = [];
72
+ console.elmlog = (str) => logs.push(str + "\n");
73
+
74
+ // Compiled by elm-test-rs from templates/Runner.elm
75
+ const { Elm } = require("./Runner.elm.js");
76
+
77
+ // Start the Elm app
78
+ const flags = { initialSeed: 1130841854, fuzzRuns: 100, filter: null };
79
+ const app = Elm.Runner.init({ flags: flags });
80
+
81
+ // Record the timing at which we received the last "runTest" message
82
+ let startTime;
83
+
84
+ // Communication from Supervisor to Elm runner via port
85
+ parentPort.on("message", (msg) => {
86
+ if (msg.type_ == "askTestsCount") {
87
+ app.ports.askTestsCount.send();
88
+ } else if (msg.type_ == "runTest") {
89
+ startTime = performance.now();
90
+ app.ports.receiveRunTest.send(msg.id);
91
+ } else {
92
+ console.error("Invalid supervisor msg.type_:", msg.type_);
93
+ }
94
+ });
95
+
96
+ // Communication from Elm runner to Supervisor via port
97
+ // Subscribe to outgoing Elm ports defined in templates/Runner.elm
98
+ app.ports.sendResult.subscribe((msg) => {
99
+ msg.type_ = "testResult";
100
+ msg.duration = performance.now() - startTime;
101
+ msg.logs = logs;
102
+ parentPort.postMessage(msg);
103
+ logs.length = 0;
104
+ });
105
+ app.ports.sendTestsCount.subscribe((msg) => {
106
+ msg.type_ = "testsCount";
107
+ msg.logs = logs;
108
+ parentPort.postMessage(msg);
109
+ logs.length = 0;
110
+ });
@@ -0,0 +1,187 @@
1
+ process.chdir(__dirname);
2
+
3
+ // From templates/polyfills.js
4
+ // Apply Node polyfills as necessary.
5
+ var window = {
6
+ Date: Date,
7
+ addEventListener: function () {},
8
+ removeEventListener: function () {},
9
+ };
10
+
11
+ var location = {
12
+ href: "",
13
+ host: "",
14
+ hostname: "",
15
+ protocol: "",
16
+ origin: "",
17
+ port: "",
18
+ pathname: "",
19
+ search: "",
20
+ hash: "",
21
+ username: "",
22
+ password: "",
23
+ };
24
+
25
+ var document = {
26
+ body: {},
27
+ createTextNode: function () {},
28
+ location: location,
29
+ };
30
+
31
+ var oldConsoleWarn = console.warn;
32
+ console.warn = function () {
33
+ if (
34
+ arguments.length === 1 &&
35
+ arguments[0].indexOf("Compiled in DEV mode") === 0
36
+ )
37
+ return;
38
+ return oldConsoleWarn.apply(console, arguments);
39
+ };
40
+
41
+ if (typeof FileList === "undefined") {
42
+ var FileList = function () {};
43
+ }
44
+
45
+ if (typeof File === "undefined") {
46
+ var File = function () {};
47
+ }
48
+
49
+ if (typeof XMLHttpRequest === "undefined") {
50
+ var XMLHttpRequest = function () {
51
+ return {
52
+ addEventListener: function () {},
53
+ open: function () {},
54
+ send: function () {},
55
+ };
56
+ };
57
+ }
58
+
59
+ if (typeof FormData === "undefined") {
60
+ var FormData = function () {
61
+ this._data = [];
62
+ };
63
+ FormData.prototype.append = function () {
64
+ this._data.push(Array.prototype.slice.call(arguments));
65
+ };
66
+ }
67
+
68
+
69
+ const { Worker } = require("worker_threads");
70
+ const readline = require("readline");
71
+ const { performance } = require("perf_hooks");
72
+
73
+ // Global variables
74
+ let testsCount, todoTests;
75
+ let reporter;
76
+ let runners = [];
77
+ let working = false;
78
+ let workersCount = 2;
79
+ let startWorkCallback = function(){};
80
+ const verbosity = 0;
81
+
82
+ // Create a long lived reporter worker
83
+ const { Elm } = require("./Reporter.elm.js");
84
+ const flags = {
85
+ initialSeed: 1130841854,
86
+ fuzzRuns: 100,
87
+ mode: "consoleNoColor",
88
+ verbosity: verbosity,
89
+ globs: [],
90
+ paths: ["/home/runner/work/elm-pages-v3-beta/elm-pages-v3-beta/generator/dead-code-review/tests/Pages/Review/DeadCodeEliminateDataTest.elm"],
91
+ };
92
+ reporter = Elm.Reporter.init({ flags: flags });
93
+
94
+ // Pipe the Elm stdout port to stdout
95
+ reporter.ports.stdout.subscribe((str) => process.stdout.write(str));
96
+
97
+ // When the reporter has finished clean runners
98
+ reporter.ports.signalFinished.subscribe(async ({ exitCode, testsCount }) => {
99
+ await Promise.all(runners.map((runner) => runner.terminate()));
100
+ working = false;
101
+ startWorkCallback();
102
+ if (verbosity >= 1) {
103
+ console.warn("Running duration (since Node.js start):", Math.round(performance.now()), "ms\n");
104
+ }
105
+ process.exit(exitCode);
106
+ });
107
+
108
+ // When receiving a CLI message, start test workers
109
+ // The message is a string containing "/path/to/node_runner.js"
110
+ const rl = readline.createInterface({ input: process.stdin });
111
+ rl.on("line", (runnerFile) => {
112
+ working ? registerWork(runnerFile) : startWork(runnerFile);
113
+ });
114
+
115
+ function registerWork(runnerFile) {
116
+ startWorkCallback = () => startWork(runnerFile);
117
+ }
118
+
119
+ function startWork(runnerFile) {
120
+ startWorkCallback = function(){};
121
+ working = true;
122
+ // Start first runner worker and prevent piped stdout and sdterr
123
+ runners[0] = new Worker(runnerFile, { stdout: true }); //, stderr: true });
124
+ runners[0].on("message", (msg) =>
125
+ handleRunnerMsg(runners[0], runnerFile, msg)
126
+ );
127
+ runners[0].on("online", () =>
128
+ runners[0].postMessage({ type_: "askTestsCount" })
129
+ );
130
+ }
131
+
132
+ // Handle a test result
133
+ function handleRunnerMsg(runner, runnerFile, msg) {
134
+ if (msg.type_ == "testsCount") {
135
+ if (msg.logs.length > 0) {
136
+ console.warn("Debug logs captured when setting up tests: -----------\n");
137
+ msg.logs.forEach((str) => process.stderr.write(str));
138
+ console.warn("\n------------------------------------------------------\n");
139
+ }
140
+ setupWithTestsCount(runnerFile, msg);
141
+ } else if (msg.type_ == "testResult") {
142
+ dispatchWork(runner, todoTests.pop());
143
+ reporter.ports.incomingResult.send(msg);
144
+ } else {
145
+ console.error("Invalid runner msg.type_:", msg.type_);
146
+ }
147
+ }
148
+
149
+ // Reset supervisor tests count and reporter
150
+ // Start work on all runners
151
+ function setupWithTestsCount(runnerFile, msg) {
152
+ // Reset supervisor tests
153
+ testsCount = msg.testsCount;
154
+ todoTests = Array(testsCount)
155
+ .fill(0)
156
+ .map((_, id) => id)
157
+ .reverse();
158
+
159
+ // Reset reporter
160
+ reporter.ports.restart.send(msg);
161
+
162
+ // Send first runner job
163
+ if (testsCount == 0) {
164
+ console.error("No exposed values of type Test was found. Did you forget to expose them?");
165
+ return;
166
+ } else {
167
+ runners[0].postMessage({ type_: "runTest", id: todoTests.pop() });
168
+ }
169
+
170
+ // Create and send work to all other workers.
171
+ let max_workers = Math.min(workersCount, testsCount);
172
+ for (let i = 1; i < max_workers; i++) {
173
+ let runner = new Worker(runnerFile); //, { stdout: true, stderr: true });
174
+ runners[i] = runner;
175
+ runner.on("message", (msg) =>
176
+ handleRunnerMsg(runner, runnerFile, msg)
177
+ );
178
+ runner.on("online", () => dispatchWork(runner, todoTests.pop()));
179
+ }
180
+ }
181
+
182
+ // Ask runner to run some test.
183
+ function dispatchWork(runner, testId) {
184
+ if (testId != undefined) {
185
+ runner.postMessage({ type_: "runTest", id: testId });
186
+ }
187
+ }
@@ -0,0 +1 @@
1
+ {"type": "commonjs"}
@@ -0,0 +1,26 @@
1
+ port module Reporter exposing (main)
2
+
3
+ import ElmTestRunner.Reporter exposing (Flags, Model, Msg)
4
+ import Json.Decode exposing (Value)
5
+
6
+
7
+ port restart : ({ kind : String, testsCount : Int } -> msg) -> Sub msg
8
+
9
+
10
+ port incomingResult : ({ duration : Float, result : Value, logs : List String } -> msg) -> Sub msg
11
+
12
+
13
+ port signalFinished : { exitCode : Int, testsCount : Int } -> Cmd msg
14
+
15
+
16
+ port stdout : String -> Cmd msg
17
+
18
+
19
+ main : Program Flags Model Msg
20
+ main =
21
+ ElmTestRunner.Reporter.worker
22
+ { restart = restart
23
+ , incomingResult = incomingResult
24
+ , stdout = stdout
25
+ , signalFinished = signalFinished
26
+ }
@@ -0,0 +1,62 @@
1
+ port module Runner exposing (main)
2
+
3
+ import Pages.Review.DeadCodeEliminateDataTest
4
+
5
+ import ElmTestRunner.Runner exposing (Flags, Model, Msg)
6
+ import Json.Encode exposing (Value)
7
+ import Test exposing (Test)
8
+
9
+
10
+ port askTestsCount : (Value -> msg) -> Sub msg
11
+
12
+
13
+ port sendTestsCount : { kind : String, testsCount : Int } -> Cmd msg
14
+
15
+
16
+ port receiveRunTest : (Int -> msg) -> Sub msg
17
+
18
+
19
+ port sendResult : { id : Int, result : Value } -> Cmd msg
20
+
21
+
22
+ {-| The implementation of this function will be replaced in the generated JS
23
+ with a version that returns `Just value` if `value` is a `Test`, otherwise `Nothing`.
24
+ If you rename or change this function you also need to update the regex that looks for it.
25
+ -}
26
+ check : a -> Maybe Test
27
+ check =
28
+ checkHelperReplaceMe___
29
+
30
+
31
+ checkHelperReplaceMe___ : a -> b
32
+ checkHelperReplaceMe___ _ =
33
+ Debug.todo """The regex for replacing this Debug.todo with some real code must have failed since you see this message!
34
+
35
+ Please report this bug: https://github.com/mpizenberg/elm-test-rs/issues/new
36
+ """
37
+
38
+
39
+ tests : List Test
40
+ tests =
41
+ [ check Pages.Review.DeadCodeEliminateDataTest.all ]
42
+ |> List.filterMap identity
43
+
44
+
45
+ main : Program Flags Model Msg
46
+ main =
47
+ let
48
+ concatenatedTest =
49
+ case tests of
50
+ [] ->
51
+ Nothing
52
+
53
+ _ ->
54
+ Just (Test.concat tests)
55
+ in
56
+ concatenatedTest
57
+ |> ElmTestRunner.Runner.worker
58
+ { askTestsCount = askTestsCount
59
+ , sendTestsCount = sendTestsCount
60
+ , receiveRunTest = receiveRunTest
61
+ , sendResult = sendResult
62
+ }
@@ -0,0 +1,35 @@
1
+ {
2
+ "type": "application",
3
+ "source-directories": [
4
+ "src",
5
+ "../../src"
6
+ ],
7
+ "elm-version": "0.19.1",
8
+ "dependencies": {
9
+ "direct": {
10
+ "elm/core": "1.0.5",
11
+ "elm-community/result-extra": "2.4.0",
12
+ "jfmengels/elm-review": "2.4.2",
13
+ "stil4m/elm-syntax": "7.2.5"
14
+ },
15
+ "indirect": {
16
+ "elm/html": "1.0.0",
17
+ "elm/json": "1.1.3",
18
+ "elm/parser": "1.1.0",
19
+ "elm/project-metadata-utils": "1.0.2",
20
+ "elm/random": "1.0.0",
21
+ "elm/time": "1.0.0",
22
+ "elm/virtual-dom": "1.0.2",
23
+ "elm-community/list-extra": "8.3.0",
24
+ "miniBill/elm-unicode": "1.0.2",
25
+ "rtfeldman/elm-hex": "1.0.0",
26
+ "stil4m/structured-writer": "1.0.3"
27
+ }
28
+ },
29
+ "test-dependencies": {
30
+ "direct": {
31
+ "elm-explorations/test": "1.2.2"
32
+ },
33
+ "indirect": {}
34
+ }
35
+ }
@@ -0,0 +1,181 @@
1
+ module Pages.Review.DeadCodeEliminateData exposing (rule)
2
+
3
+ import Elm.Syntax.Declaration as Declaration exposing (Declaration)
4
+ import Elm.Syntax.Expression as Expression exposing (Expression)
5
+ import Elm.Syntax.Node as Node exposing (Node)
6
+ import Review.Fix
7
+ import Review.ModuleNameLookupTable as ModuleNameLookupTable exposing (ModuleNameLookupTable)
8
+ import Review.Rule as Rule exposing (Error, Rule)
9
+
10
+
11
+ type alias Context =
12
+ { lookupTable : ModuleNameLookupTable }
13
+
14
+
15
+ rule : Rule
16
+ rule =
17
+ Rule.newModuleRuleSchemaUsingContextCreator "Pages.Review.DeadCodeEliminateData" initialContext
18
+ |> Rule.withExpressionEnterVisitor expressionVisitor
19
+ |> Rule.withDeclarationEnterVisitor declarationVisitor
20
+ |> Rule.fromModuleRuleSchema
21
+
22
+
23
+ initialContext : Rule.ContextCreator () Context
24
+ initialContext =
25
+ Rule.initContextCreator
26
+ (\lookupTable () ->
27
+ { lookupTable = lookupTable
28
+ }
29
+ )
30
+ |> Rule.withModuleNameLookupTable
31
+
32
+
33
+ declarationVisitor : Node Declaration -> Context -> ( List (Error {}), Context )
34
+ declarationVisitor node context =
35
+ case Node.value node of
36
+ Declaration.FunctionDeclaration { declaration } ->
37
+ case Node.value declaration of
38
+ { name, expression } ->
39
+ case ( Node.value name, Node.value expression ) of
40
+ ( "template", Expression.RecordExpr setters ) ->
41
+ let
42
+ dataFieldValue : Maybe (Node ( Node String, Node Expression ))
43
+ dataFieldValue =
44
+ setters
45
+ |> List.filterMap
46
+ (\recordSetter ->
47
+ case Node.value recordSetter of
48
+ ( keyNode, valueNode ) ->
49
+ if Node.value keyNode == "data" || Node.value keyNode == "action" then
50
+ if isAlreadyApplied (Node.value valueNode) then
51
+ Nothing
52
+
53
+ else
54
+ recordSetter |> Just
55
+
56
+ else
57
+ Nothing
58
+ )
59
+ |> List.head
60
+ in
61
+ dataFieldValue
62
+ |> Maybe.map
63
+ (\dataValue ->
64
+ ( [ Rule.errorWithFix
65
+ { message = "Codemod"
66
+ , details = [ "" ]
67
+ }
68
+ (Node.range dataValue)
69
+ -- TODO need to check the right way to refer to `DataSource.fail` based on imports
70
+ -- TODO need to replace `action` as well
71
+ [ Review.Fix.replaceRangeBy (Node.range dataValue) "data = DataSource.fail \"\"\n "
72
+ ]
73
+ ]
74
+ , context
75
+ )
76
+ )
77
+ |> Maybe.withDefault
78
+ ( [], context )
79
+
80
+ _ ->
81
+ ( [], context )
82
+
83
+ _ ->
84
+ ( [], context )
85
+
86
+
87
+ expressionVisitor : Node Expression -> Context -> ( List (Error {}), Context )
88
+ expressionVisitor node context =
89
+ case Node.value node of
90
+ Expression.Application applicationExpressions ->
91
+ case applicationExpressions |> List.map (\applicationNode -> ( ModuleNameLookupTable.moduleNameFor context.lookupTable applicationNode, Node.value applicationNode )) of
92
+ [ ( Just [ "RouteBuilder" ], Expression.FunctionOrValue _ pageBuilderName ), ( _, Expression.RecordExpr fields ) ] ->
93
+ let
94
+ dataFieldValue : List ( String, Node ( Node String, Node Expression ) )
95
+ dataFieldValue =
96
+ fields
97
+ |> List.filterMap
98
+ (\recordSetter ->
99
+ case Node.value recordSetter of
100
+ ( keyNode, valueNode ) ->
101
+ if Node.value keyNode == "data" || Node.value keyNode == "action" then
102
+ if isAlreadyApplied (Node.value valueNode) then
103
+ Nothing
104
+
105
+ else
106
+ ( Node.value keyNode, recordSetter ) |> Just
107
+
108
+ else
109
+ Nothing
110
+ )
111
+ in
112
+ ( dataFieldValue
113
+ |> List.concatMap
114
+ (\( key, dataValue ) ->
115
+ [ Rule.errorWithFix
116
+ { message = "Codemod"
117
+ , details = [ "" ]
118
+ }
119
+ (Node.range dataValue)
120
+ [ Review.Fix.replaceRangeBy (Node.range dataValue)
121
+ (key
122
+ ++ " = "
123
+ ++ (case pageBuilderName of
124
+ "preRender" ->
125
+ "\\_ -> DataSource.fail \"\""
126
+
127
+ "preRenderWithFallback" ->
128
+ "\\_ -> DataSource.fail \"\""
129
+
130
+ "serverRender" ->
131
+ "\\_ -> Request.oneOf []\n "
132
+
133
+ "single" ->
134
+ "DataSource.fail \"\"\n "
135
+
136
+ _ ->
137
+ "data"
138
+ )
139
+ )
140
+ ]
141
+ ]
142
+ )
143
+ , context
144
+ )
145
+
146
+ _ ->
147
+ ( [], context )
148
+
149
+ _ ->
150
+ ( [], context )
151
+
152
+
153
+ isAlreadyApplied : Expression -> Bool
154
+ isAlreadyApplied expression =
155
+ case expression of
156
+ Expression.LambdaExpression info ->
157
+ case Node.value info.expression of
158
+ Expression.Application applicationNodes ->
159
+ case applicationNodes |> List.map Node.value of
160
+ (Expression.FunctionOrValue [ "DataSource" ] "fail") :: _ ->
161
+ True
162
+
163
+ (Expression.FunctionOrValue [ "Request" ] "oneOf") :: (Expression.ListExpr []) :: _ ->
164
+ True
165
+
166
+ _ ->
167
+ False
168
+
169
+ _ ->
170
+ False
171
+
172
+ Expression.Application applicationNodes ->
173
+ case applicationNodes |> List.map Node.value of
174
+ (Expression.FunctionOrValue [ "DataSource" ] "fail") :: _ ->
175
+ True
176
+
177
+ _ ->
178
+ False
179
+
180
+ _ ->
181
+ False
@@ -0,0 +1,9 @@
1
+ module ReviewConfig exposing (config)
2
+
3
+ import Pages.Review.DeadCodeEliminateData
4
+ import Review.Rule as Rule exposing (Rule)
5
+
6
+
7
+ config : List Rule
8
+ config =
9
+ [ Pages.Review.DeadCodeEliminateData.rule ]