Skip to content

Commit

Permalink
Merge pull request #82 from 515hikaru/feature/add-prettier
Browse files Browse the repository at this point in the history
Prettierを導入する
  • Loading branch information
515hikaru authored Aug 28, 2020
2 parents 9f52e25 + d415c28 commit 305391f
Show file tree
Hide file tree
Showing 8 changed files with 228 additions and 257 deletions.
21 changes: 10 additions & 11 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,20 @@ module.exports = {
"jest/globals": true,
},
parser: "@typescript-eslint/parser",
extends: [
'standard'
],
extends: ["standard"],
globals: {
Atomics: 'readonly',
SharedArrayBuffer: 'readonly'
Atomics: "readonly",
SharedArrayBuffer: "readonly",
},
parserOptions: {
ecmaVersion: 11
ecmaVersion: 11,
},
rules: {
"no-irregular-whitespace": 0,
quotes: ["warn", "double"],
"comma-dangle": ["warn", "always-multiline"],
semi: ["error", "never"],
"space-before-function-paren": ["error", "never"],
},
plugins: [
"@typescript-eslint",
"jest",
]
}
plugins: ["@typescript-eslint", "jest"],
};
3 changes: 3 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
semi: false,
}
6 changes: 6 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-standard": "^4.0.1",
"jest": "^26.1.0",
"prettier": "^2.1.1",
"ts-jest": "^26.1.3",
"webpack": "^4.43.0",
"webpack-cli": "^3.3.12"
Expand Down
18 changes: 9 additions & 9 deletions src/__tests__/main.spec.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import { transform } from '../main'
import { transform } from "../main"

describe('test parsing', () => {
test('normal parsing', () => {
const text = 'foo\n'
const expected = ' foo\n'
describe("test parsing", () => {
test("normal parsing", () => {
const text = "foo\n"
const expected = " foo\n"
const result = transform(text)
expect(result).toBe(expected)
})

test('do not have last newline', () => {
const text = 'foo'
const expected = ' foo\n'
test("do not have last newline", () => {
const text = "foo"
const expected = " foo\n"
const result = transform(text)
expect(result).toBe(expected)
})

test('using sample string for testing parser', () => {
test("using sample string for testing parser", () => {
const text = `abc
def
Expand Down
Loading

0 comments on commit 305391f

Please sign in to comment.