forked from microsoft/fluentui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
lint-staged.config.js
27 lines (19 loc) · 1.15 KB
/
lint-staged.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// @ts-check
const { configHelpers } = require('./packages/eslint-plugin/src/index');
const eslintGlob = `*.{${configHelpers.extensions.join(',')}}`;
// https://www.npmjs.com/package/lint-staged
module.exports = {
// Run eslint in fix mode followed by prettier (must be done in sequence, separate from other
// prettier formatting, since both commands can modify files)
[eslintGlob]: ['node ./scripts/lint-staged/eslint', 'prettier --write'],
// Run prettier on non-eslintable files (ignores handled by .prettierignore)
[`!(${eslintGlob})`]: 'prettier --write',
'common/changes/*.json': 'node ./scripts/lint-staged/auto-convert-change-files',
'**/tslint.json': 'node ./scripts/lint-staged/no-tslint-json',
'**/package.json': 'node ./scripts/lint-staged/no-tslint-deps',
'packages/!(react-examples)/!(fluentui)/**/(docs|examples)/*.{ts,tsx,scss,md}':
'node ./scripts/lint-staged/no-old-example-paths',
'packages/!(react-examples)/!(fluentui)/**/*.doc.ts*': 'node ./scripts/lint-staged/no-old-example-paths',
'packages/{react,react-cards,react-focus}/src/components/__snapshots__/*':
'node ./scripts/lint-staged/no-old-snapshot-paths',
};