Skip to content

Format code with prettier #149

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
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.
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>;
12 changes: 6 additions & 6 deletions html/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

/* Basic Options */
// "incremental": true, /* Enable incremental compilation */
"target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */
"target": "es5" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */,
"module": "commonjs" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */,
// "lib": [], /* Specify library files to be included in the compilation. */
// "allowJs": true, /* Allow javascript files to be compiled. */
// "checkJs": true, /* Report errors in .js files. */
Expand All @@ -25,7 +25,7 @@
// "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */

/* Strict Type-Checking Options */
"strict": true, /* Enable all strict type-checking options. */
"strict": true /* Enable all strict type-checking options. */,
// "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
// "strictNullChecks": true, /* Enable strict null checks. */
// "strictFunctionTypes": true, /* Enable strict checking of function types. */
Expand All @@ -49,7 +49,7 @@
// "typeRoots": [], /* List of folders to include type definitions from. */
// "types": [], /* Type declaration files to be included in compilation. */
// "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
"esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
"esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */,
// "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */

Expand All @@ -64,7 +64,7 @@
// "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */

/* Advanced Options */
"skipLibCheck": true, /* Skip type checking of declaration files. */
"forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */
"skipLibCheck": true /* Skip type checking of declaration files. */,
"forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */
}
}
24 changes: 9 additions & 15 deletions html/typescript.ts
Original file line number Diff line number Diff line change
@@ -1,38 +1,32 @@
// JS-0293
let a: Array<number> = [];


// JS-0298
class Mx {
public static get foo() {
return 1;
}
public static get foo() {
return 1;
}
}

// JS-0301
type T = { x: number; };


type T = { x: number };

// JS-0316
new Array(0, 1, 2);

// JS-0324
function foo(bar?: { n: number }) {
return (bar)!?.n;
return bar!?.n;
}

// JS-0331
class Foo {
a: number = 5;
b: boolean = true;
c: string = 'foo';
a: number = 5;
b: boolean = true;
c: string = "foo";
}

// JS-0364
declare module foo {
declare module bar {}
declare module bar {}
}



26 changes: 13 additions & 13 deletions html/typescript_airbnb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,42 +6,42 @@ function foo(a: String) {}

// JS-0298
class Mx {
public static get foo() {
return 1;
}
public static get foo() {
return 1;
}
}

// JS-0301
type T = { x: number; };
type T = { x: number };

// JS-0312
interface Foo {
name: string
age: number
name: string;
age: number;
}

// JS-0316
new Array(0, 1, 2);

// JS-0324
function foo(bar?: { n: number }) {
return (bar)!?.n;
return bar!?.n;
}

// JS-0331
class Foo {
a: number = 5;
b: boolean = true;
c: string = 'foo';
a: number = 5;
b: boolean = true;
c: string = "foo";
}

// JS-0364
declare module foo {
declare module bar {}
declare module bar {}
}

// JS-0385
function foo(a : string) {}
function foo(a: string) {}

// JS-0311
const fn = (a: number = 5, b: boolean = true, c: string = 'foo') => {};
const fn = (a: number = 5, b: boolean = true, c: string = "foo") => {};
26 changes: 13 additions & 13 deletions html/typescript_no_meta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,42 +6,42 @@ function foo(a: String) {}

// JS-0298
class Mx {
public static get foo() {
return 1;
}
public static get foo() {
return 1;
}
}

// JS-0301
type T = { x: number; };
type T = { x: number };

// JS-0312
interface Foo {
name: string
age: number
name: string;
age: number;
}

// JS-0316
new Array(0, 1, 2);

// JS-0324
function foo(bar?: { n: number }) {
return (bar)!?.n;
return bar!?.n;
}

// JS-0331
class Foo {
a: number = 5;
b: boolean = true;
c: string = 'foo';
a: number = 5;
b: boolean = true;
c: string = "foo";
}

// JS-0364
declare module foo {
declare module bar {}
declare module bar {}
}

// JS-0385
function foo(a : string) {}
function foo(a: string) {}

// JS-0311
const fn = (a: number = 5, b: boolean = true, c: string = 'foo') => {};
const fn = (a: number = 5, b: boolean = true, c: string = "foo") => {};
14 changes: 7 additions & 7 deletions html/vue/JS-0614.vue
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<script>
/* ✗ BAD */
Vue.component('some-comp', {
Vue.component("some-comp", {
data: {
foo: 'bar'
}
})
foo: "bar",
},
});

export default {
data: {
foo: 'bar'
}
}
foo: "bar",
},
};
</script>
Loading