Skip to content

Commit

Permalink
welcome prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
viqueen committed May 24, 2023
1 parent 3698e15 commit 530e110
Show file tree
Hide file tree
Showing 10 changed files with 43 additions and 14 deletions.
4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.idea/
dist/
node_modules/
coverage/
19 changes: 19 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
module.exports = {
overrides: [
{
files: '*.js',
options: {
tabWidth: 4,
singleQuote: true,
},
},
{
files: '*.ts',
options: {
tabWidth: 4,
singleQuote: true,
trailingComma: 'none',
},
},
],
};
2 changes: 1 addition & 1 deletion jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ export default async (): Promise<Config> => {
testMatch: ['**/?(*.)+(spec|test).+(ts)'],
verbose: true
};
};
};
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,15 @@
"build": "tsc",
"build:watch": "tsc --watch",
"test": "jest",
"test:watch": "jest --watchAll"
"test:watch": "jest --watchAll",
"format:check": "prettier --check .",
"format": "prettier --check --write ."
},
"devDependencies": {
"@types/jest": "^29.5.1",
"@types/node": "^20.2.3",
"jest": "^29.5.0",
"prettier": "^2.8.8",
"ts-jest": "^29.1.0",
"ts-node": "^10.9.1",
"typescript": "^5.0.4"
Expand Down
6 changes: 3 additions & 3 deletions src/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {project} from "./index";
import { project } from './index';

describe('project', () => {
it('should add project as prefix', () => {
const withPrefix = project('hello');
expect(withPrefix).toEqual(`project hello`);
})
})
});
});
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const project = (name: string) => {
return `project ${name}`;
}
};

export { project };
export { project };
2 changes: 1 addition & 1 deletion test/global-setup.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export default async () => {
// ignore
}
};
2 changes: 1 addition & 1 deletion test/global-teardown.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export default async () => {
// ignore
}
};
8 changes: 3 additions & 5 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,14 @@
"skipLibCheck": true,
"sourceMap": true,
"strict": true,
"target": "ES2017",
"target": "ES2017"
},
"include": [
"src"
],
"include": ["src"],
"exclude": [
"src/**/*.test.ts",
"src/**/*.spec.ts",
"src/**/*.test.tsx",
"src/**/*.spec.tsx",
"src/**/*.snap"
]
}
}
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1910,6 +1910,11 @@ pkg-dir@^4.2.0:
dependencies:
find-up "^4.0.0"

prettier@^2.8.8:
version "2.8.8"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.8.tgz#e8c5d7e98a4305ffe3de2e1fc4aca1a71c28b1da"
integrity sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==

pretty-format@^29.0.0, pretty-format@^29.5.0:
version "29.5.0"
resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.5.0.tgz#283134e74f70e2e3e7229336de0e4fce94ccde5a"
Expand Down

0 comments on commit 530e110

Please sign in to comment.