Skip to content

Commit

Permalink
Consolidate prettier (#1066)
Browse files Browse the repository at this point in the history
* Consolidate all prettier configurations to the root dir

* Run prettier

* updates based on kbax and rcebulko nits

* rerun prettier
  • Loading branch information
samouri authored Jun 16, 2021
1 parent 1f7faa0 commit af09257
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 20 deletions.
2 changes: 1 addition & 1 deletion config/.prettierrc → .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
"trailingComma": "all",
"parser": "typescript",
"singleQuote": true
}
}
5 changes: 4 additions & 1 deletion src/test/worker-thread/AnimationFrame.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@
import anyTest, { TestInterface } from 'ava';
import { rafPolyfill, cafPolyfill } from '../../worker-thread/AnimationFrame';

const test = anyTest as TestInterface<{ runTimeout: Function; runAllTimeouts: Function }>;
const test = anyTest as TestInterface<{
runTimeout: Function;
runAllTimeouts: Function;
}>;
const originalSetTimeout = globalThis.setTimeout;

test.beforeEach((t) => {
Expand Down
6 changes: 0 additions & 6 deletions tools/linter/.prettierrc

This file was deleted.

5 changes: 0 additions & 5 deletions tools/linter/config/.prettierrc

This file was deleted.

2 changes: 1 addition & 1 deletion tools/linter/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

const DICT = require('./dict');

module.exports = function({ types: t }) {
module.exports = function ({ types: t }) {
return {
visitor: {
/**
Expand Down
12 changes: 6 additions & 6 deletions tools/linter/test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ import { transformFileSync } from '@babel/core';

const FIXTURES_DIR = path.join(__dirname, 'fixtures');

test.beforeEach(t => {
test.beforeEach((t) => {
const warnings = [];
console.test = function(warning) {
console.test = function (warning) {
warnings.push(warning);
};

Expand All @@ -31,7 +31,7 @@ test.beforeEach(t => {
};
});

test.afterEach(t => {
test.afterEach((t) => {
delete console.test;
t.context.warnings.length = 0;
});
Expand All @@ -40,7 +40,7 @@ function process(fixture) {
transformFileSync(path.join(FIXTURES_DIR, fixture + '.js'));
}

test.serial('test matching-no-ok', t => {
test.serial('test matching-no-ok', (t) => {
process('matching-no-ok');

const { warnings } = t.context;
Expand Down Expand Up @@ -83,14 +83,14 @@ test.serial('test matching-no-ok', t => {
t.true(warnings[14].message.indexOf('offsetWidth') != -1);
});

test.serial('test matching-ok', t => {
test.serial('test matching-ok', (t) => {
process('matching-ok');

const { warnings } = t.context;
t.is(warnings.length, 0);
});

test.serial('test not-matching', t => {
test.serial('test not-matching', (t) => {
process('not-matching');

const { warnings } = t.context;
Expand Down

0 comments on commit af09257

Please sign in to comment.