Skip to content

Format code with prettier #163

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2,038 changes: 2,037 additions & 1 deletion .deepsource/issues.json

Large diffs are not rendered by default.

14 changes: 3 additions & 11 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
{
"extends": [
"airbnb",
"standard-with-typescript",
"eslint:all",
"standard"
],
"plugins": [
"node",
"security"
],
"extends": ["airbnb", "standard-with-typescript", "eslint:all", "standard"],
"plugins": ["node", "security"],
"env": {
"node": true,
"es6": true,
Expand All @@ -25,4 +17,4 @@
"worsevalue": false,
"wtf": true
}
}
}
11 changes: 5 additions & 6 deletions a.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import something from '.does-not-exist'
import b from './b'

let foo = {}
let bar = foo?.foobar
import something from ".does-not-exist";
import b from "./b";

let foo = {};
let bar = foo?.foobar;

function f(x) {
x = 1
x = 1;
}
68 changes: 33 additions & 35 deletions b.js
Original file line number Diff line number Diff line change
@@ -1,90 +1,88 @@
import a from './a'
import { unserialize as uns } from 'node-serialize'
import c from 'csurf'
import a from "./a";
import { unserialize as uns } from "node-serialize";
import c from "csurf";
import execa from "execa";
import nodemailer from 'nodemailer'
import nodemailer from "nodemailer";

const transporter = nodemailer.createTransport({ secure: false })

uns(xyz)
c({ cookie: { secure: false } })
const transporter = nodemailer.createTransport({ secure: false });

uns(xyz);
c({ cookie: { secure: false } });

const _ = (req, res) => {
const x = "ls " + req.body.args;

execa.command(x);
}
};

const _2 = (req, res) => {
const x = "ls " + req.body.args;

execa.command(x);
}
};

const express = require('express');
const helmet = require('helmet');
const express = require("express");
const helmet = require("helmet");

const app = express();

app.use(
helmet.referrerPolicy({
policy: ["no-referrer"]
policy: ["no-referrer"],
})
);

const cp = require("child_process");
const { exec } = require("child_process");

const cp = require("child_process")
const { exec } = require("child_process")
const proc = "foobar";
cp.exec(proc); // unsafe

const proc = "foobar"
cp.exec(proc) // unsafe
cp.exec("ls"); // safe

cp.exec("ls") // safe
cp.execFile(proc); // unsafe

cp.execFile(proc) // unsafe

exec("fubar") // safe
exec("./" + proc) // unsafe
exec("fubar"); // safe
exec("./" + proc); // unsafe

export async function f(x) {
return async function g() {
return async function h() {
return !!!!!x
}
}
return !!!!!x;
};
};
}

export async function f2(xs) {
const ys = []
const ys = [];
for await (const x of xs) {
ys.push(x)
ys.push(x);
}
return ys
return ys;
}

export class BadClass {
async foo() {
return 1
return 1;
}
}

export const badObject = {
async f() {
return 1
return 1;
},

g: async function () {
return 2
return 2;
},

h: async () => 3
}
h: async () => 3,
};

if (!!(1 + 2)) {
// empty
}

export default 2
export default 2;

const x = import('x');
const x = import("x");
9 changes: 5 additions & 4 deletions bad-code.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/usr/bin/env node
if (x.length > 0) {
const a = Boolean(false);
const b = Number(false);
const c = String('hello');
if (x === null) { }
const a = Boolean(false);
const b = Number(false);
const c = String("hello");
if (x === null) {
}
}
4 changes: 2 additions & 2 deletions esm.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import f from "./foo";
import b from 'b';
import a from 'a';
import b from "b";
import a from "a";

export const p = new Promise((resolve, _reject) => {
resolve(100);
Expand Down
51 changes: 28 additions & 23 deletions html/ember.js
Original file line number Diff line number Diff line change
@@ -1,50 +1,55 @@
// JS-0775
import { computed } from '@ember/object';
import Component from '@ember/component';
import { tracked } from '@glimmer/tracking';
import { computed } from "@ember/object";
import Component from "@ember/component";
import { tracked } from "@glimmer/tracking";
class Class1 extends Component {
@tracked x; // This is included just to make sure it gets ignored in the next class.
}
class Class2 extends Component {
@computed('x') get myProp() {}
myFunction() { this.x = 123; }
@computed("x") get myProp() {}
myFunction() {
this.x = 123;
}
}




export default class Router extends EmberRouter {
location = ''
rootURL = 'config.rootURL'
location = "";
rootURL = "config.rootURL";
}

// JS-0782
class Foo { init() { this._super.apply(this, arguments); } }
class Foo {
init() {
this._super.apply(this, arguments);
}
}

// JS-0785
const test = this.getWithDefault('key', []);
const test = this.getWithDefault("key", []);

// JS-0797
import { setupOnerror } from '@ember/test-helpers';
import { module as moduleVariable } from 'qunit';
moduleVariable('foo', function(hooks) {
hooks.beforeEach(function() {
import { setupOnerror } from "@ember/test-helpers";
import { module as moduleVariable } from "qunit";
moduleVariable("foo", function (hooks) {
hooks.beforeEach(function () {
setupOnerror(() => {});
});
});

// JS-0799
import { log } from 'ember-debug';
import { log } from "ember-debug";

// JS-0809
Router.map(function () {
this.route('about')
this.route("about");
// JS-0778:
this.route('Home')
this.route('SignUp')
this.route("Home");
this.route("SignUp");
// JS-0809: fixables
this.route('blog-posts', { path: '/blog-posts' })
})
this.route("blog-posts", { path: "/blog-posts" });
});

// JS-0812
computed(function() { return this.nested.children.mapBy('age'); })
computed(function () {
return this.nested.children.mapBy("age");
});
6 changes: 3 additions & 3 deletions html/flow.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ type foof = { bar: string };
// Message: Object type must be exact.

// Options: ["always"]
type foofoo = Array<{bar: string}>;
type foofoo = Array<{ bar: string }>;
// Message: Object type must be exact.

// Options: ["always"]
(foofoof: Array<{bar: string}>) => {};
// Message: Object type must be exact.
(foofoof: Array<{ bar: string }>) => {};
// Message: Object type must be exact.
2 changes: 1 addition & 1 deletion html/foo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { Inject, Fubar, Fu } from "foo";
export default class Foo {
// doc
constructor(@Inject(Fubar) private readonly fu: Fu) {
this.f()
this.f();
}

// doc comment
Expand Down
22 changes: 10 additions & 12 deletions html/index.html
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
</head>

<body>
<b>
Foobar barbaz
</b>
</body>
</html>
<body>
<b> Foobar barbaz </b>
</body>
</html>
14 changes: 7 additions & 7 deletions html/index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@

let e = [
function foo() {
dosomething();
}, function bar() {
dosomething();
}
function foo() {
dosomething();
},
function bar() {
dosomething();
},
];

var foo = Boolean(bar);
var foo = Boolean(bar);
2 changes: 1 addition & 1 deletion html/index.vue
Original file line number Diff line number Diff line change
@@ -1 +1 @@
// JS-0614
// JS-0614
36 changes: 20 additions & 16 deletions html/react.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,36 @@
<Element foo={true} />;

// JS-0410
{<React.Fragment><Bar /></React.Fragment>}
{
<React.Fragment>
<Bar />
</React.Fragment>;
}

// JS-0425: react/jsx-one-expression-per-line
<Bar><Hello /></Bar>
<Bar>
<Hello />
</Bar>;

// "react/no-unknown-property": "JS-0455",
var HelloWorld = <div class="hello">Hello World</div>;

// JS-0430
<App
a={true}
z
r
_onClick={function(){}}
onHandle={function(){}}
{...this.props}
b={false}
{...otherProps}
a={true}
z
r
_onClick={function () {}}
onHandle={function () {}}
{...this.props}
b={false}
{...otherProps}
>
{test}
</App>
{test}
</App>;

// JS-0461
const Hello = (props: {-name: string}) => (
<div>Hello {props.name}</div>
);
const Hello = (props: { -name: string }) => <div>Hello {props.name}</div>;

// JS-0468
var contentContainer = <div className="content"></div>;
var contentContainer = <div className="content"></div>;
Loading