Skip to content

Commit 0688271

Browse files
fix(lint-staged): only lint src files for now
there is an issue when we try to run lint-staged with the glob {src, test}/**/*.ts because the tsconfig will exclude the test files and therefor the tslint script complains about not finding the all the required project files
1 parent 4acac3b commit 0688271

File tree

5 files changed

+166
-38
lines changed

5 files changed

+166
-38
lines changed

.lintstagedrc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
linters:
2-
"{src}/**/*.ts":
2+
"src/**/*(!spec).ts":
33
- prettier --write --config ./.prettierrc.yml
44
- tslint --project ./tsconfig.json -t codeFrame --fix
55
- git add

package-lock.json

Lines changed: 157 additions & 32 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
"greenkeeper-lockfile": "^1.15.1",
6767
"husky": "^1.2.0",
6868
"jest": "^23.6.0",
69-
"lint-staged": "^7.2.2",
69+
"lint-staged": "^8.1.0",
7070
"lodash": "^4.17.11",
7171
"lodash.camelcase": "^4.3.0",
7272
"prettier": "^1.15.2",

src/mapper/mapper.spec.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -222,8 +222,11 @@ describe('Mapper', () => {
222222
})
223223

224224
it('complex object', () => {
225-
226-
interface ObjType{ name: StringAttribute; age: NumberAttribute; children: ListAttribute }
225+
interface ObjType {
226+
name: StringAttribute
227+
age: NumberAttribute
228+
children: ListAttribute
229+
}
227230
const attrValue = <MapAttribute<ObjType>>toDbOne({
228231
name: 'Max',
229232
age: 35,
@@ -839,7 +842,6 @@ describe('Mapper', () => {
839842
expect(Array.isArray(birthday.presents)).toBeTruthy()
840843
})
841844

842-
843845
it('awards', () => {
844846
expect(organization.awards).toBeDefined()
845847
expect(organization.awards instanceof Set).toBeTruthy()
@@ -852,7 +854,7 @@ describe('Mapper', () => {
852854
expect(award).toBe('Best of Swiss Web')
853855
})
854856

855-
it('events', ()=>{
857+
it('events', () => {
856858
expect(organization.events).toBeDefined()
857859
expect(organization.events instanceof Set).toBeTruthy()
858860

test/models/employee.model.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { DateProperty, Model, SortedSet } from '../../src/dynamo-easy'
22

3+
// comment
34
@Model()
45
export class Employee {
56
name: string

0 commit comments

Comments
 (0)