Skip to content

Commit ff55a3c

Browse files
committed
feat(deps): upgrade lint-staged to 10.x
1 parent 6cd4663 commit ff55a3c

File tree

4 files changed

+36
-178
lines changed

4 files changed

+36
-178
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
"is-ci": "^2.0.0",
8080
"jest": "^24.9.0",
8181
"jest-watch-typeahead": "^0.4.2",
82-
"lint-staged": "^9.5.0",
82+
"lint-staged": "^10.0.7",
8383
"lodash.camelcase": "^4.3.0",
8484
"lodash.has": "^4.5.2",
8585
"lodash.omit": "^4.5.0",

src/config/__tests__/lintstagedrc.js

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,30 +9,24 @@ afterEach(() => {
99
jest.resetModules()
1010
})
1111

12-
test('includes format and git add when not opted out', () => {
12+
test('includes format when not opted out', () => {
1313
utilsMock.isOptedOut.mockImplementation((key, t, f) => f)
1414
const config = require('../lintstagedrc')
1515
const jsLinter = getJsLinter(config)
1616
expect(hasFormat(jsLinter)).toBe(true)
17-
expect(hasGitAdd(jsLinter)).toBe(true)
1817
})
1918

20-
test('does not include format and git add when opted out', () => {
19+
test('does not include format when opted out', () => {
2120
utilsMock.isOptedOut.mockImplementation((key, t) => t)
2221
const config = require('../lintstagedrc')
2322
const jsLinter = getJsLinter(config)
2423
expect(hasFormat(jsLinter)).toBe(false)
25-
expect(hasGitAdd(jsLinter)).toBe(false)
2624
})
2725

2826
function hasFormat(linter) {
2927
return linter.some(l => l.includes('format'))
3028
}
3129

32-
function hasGitAdd(linter) {
33-
return linter.includes('git add')
34-
}
35-
3630
function getJsLinter(linters) {
3731
const key = Object.keys(linters).find(
3832
k => k.includes('*') && k.includes('js'),

src/config/lintstagedrc.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,10 @@ const kcdScripts = resolveHoverScripts()
44
const doctoc = resolveBin('doctoc')
55

66
module.exports = {
7-
'README.md': [`${doctoc} --maxlevel 3 --notitle`, 'git add'],
7+
'README.md': [`${doctoc} --maxlevel 3 --notitle`],
88
'*.+(js|jsx|json|yml|yaml|css|less|scss|ts|tsx|md|graphql|mdx)': [
99
isOptedOut('autoformat', null, `${kcdScripts} format`),
1010
`${kcdScripts} lint`,
1111
`${kcdScripts} test --findRelatedTests`,
12-
isOptedOut('autoformat', null, 'git add'),
1312
].filter(Boolean),
1413
}

0 commit comments

Comments
 (0)