Browse Source

Move "use strict" directives up

Move "use strict" directives to the first line of each file. In
particular, move them above any ESLint comments, which are far less
important.

There are few exceptions:

  Executable files

    In these, the "use strict" directive must give way to the shebang.

  lib/parser.js

    Here, the "Generated by..." comment comes first. Also, ESLint
    comments are prepended in post-processing.
redux
David Majda 5 years ago
parent
commit
c134e06229
  1. 6
      benchmark/index.js
  2. 4
      benchmark/run
  3. 4
      benchmark/runner.js
  4. 4
      benchmark/server
  5. 4
      spec/api/generated-parser-api.spec.js
  6. 4
      spec/behavior/generated-parser-behavior.spec.js
  7. 4
      spec/server

6
benchmark/index.js

@ -1,11 +1,11 @@
"use strict";
/* eslint-env browser, jquery */
let benchmarks = require("./benchmarks.js");
let Runner = require("./runner.js");
$("#run").click(() => {
"use strict";
// Results Table Manipulation
let resultsTable = $("#results-table");
@ -134,7 +134,5 @@ $("#run").click(() => {
});
$(document).ready(() => {
"use strict";
$("#run").focus();
});

4
benchmark/run

@ -1,10 +1,10 @@
#!/usr/bin/env node
"use strict";
/* eslint-env node */
/* eslint no-console: 0*/
"use strict";
let fs = require("fs");
let benchmarks = require("./benchmarks.js");

4
benchmark/runner.js

@ -1,7 +1,7 @@
/* global setTimeout */
"use strict";
/* global setTimeout */
let peg = require("../lib/peg");
let Runner = {

4
benchmark/server

@ -1,10 +1,10 @@
#!/usr/bin/env node
"use strict";
/* eslint-env node */
/* eslint no-console: 0 */
"use strict";
// Small server whose main purpose is to ensure that both the benchmarked code
// and the benchmark get passed through Babel & Browserify before they are
// served to the browser.

4
spec/api/generated-parser-api.spec.js

@ -1,8 +1,8 @@
"use strict";
/* eslint no-console: 0 */
/* global console */
"use strict";
let peg = require("../../lib/peg");
describe("generated parser API", function() {

4
spec/behavior/generated-parser-behavior.spec.js

@ -1,8 +1,8 @@
"use strict";
/* eslint no-console: 0 */
/* global console */
"use strict";
let peg = require("../../lib/peg");
describe("generated parser behavior", function() {

4
spec/server

@ -1,10 +1,10 @@
#!/usr/bin/env node
"use strict";
/* eslint-env node */
/* eslint no-console: 0 */
"use strict";
// Small server whose main purpose is to ensure that both the specced code and
// the specs get passed through Babel & Browserify before they are served to the
// browser.

Loading…
Cancel
Save