-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* lint changed files * abstract jest-runner-eslint + add onlyDiff option * added tests & fixture files + default is onlyDiff * add changeset + fix js fixture * updated index.test and app.test tests * update jest-runner-eslint folder name in pkg json * use git config default branch if no remote origin * use ternary * update yarn.lock * update getworkspaceinfo snapshot * clean up snapshot * moved jest.setTimeout + eslint-config-modular-app * refresh yarn * use modular lint in lint-staged * delete config.js file and move into index.js * update snapshot * update snapshots Co-authored-by: Cang Truong <[email protected]> Co-authored-by: Luke Sheard <[email protected]>
- Loading branch information
1 parent
429b124
commit 89574bc
Showing
24 changed files
with
720 additions
and
366 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
'modular-scripts': minor | ||
--- | ||
|
||
Added `modular lint` command which tests diffed files against eslint and reports | ||
on passing and failing files, set to not tolerate any warnings and cache | ||
results. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
import '@testing-library/jest-dom'; | ||
|
||
// Certain tests perform installs that take a while | ||
jest.setTimeout(10 * 60 * 1000); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
'use strict'; | ||
|
||
const { createJestRunner } = require('create-jest-runner'); | ||
|
||
const runner = createJestRunner( | ||
require.resolve('jest-runner-eslint/build/runner/runESLint'), | ||
{ | ||
getExtraOptions: () => ({ | ||
cache: true, | ||
maxWarnings: 0, | ||
fix: process.env.MODULAR_LINT_FIX | ||
? process.env.MODULAR_LINT_FIX.toLowerCase() === 'true' | ||
: false, | ||
}), | ||
}, | ||
); | ||
|
||
module.exports = runner; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
packages/modular-scripts/src/__tests__/__fixtures__/lint/InvalidJS.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/* eslint-disable */ | ||
|
||
const path = require('path'); | ||
|
||
function funcHasNoType(props) { | ||
let type; | ||
|
||
if (type) { | ||
} else { | ||
} | ||
|
||
const emptyFunc = () => {}; | ||
} |
9 changes: 9 additions & 0 deletions
9
packages/modular-scripts/src/__tests__/__fixtures__/lint/InvalidJSX.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/* eslint-disable */ | ||
|
||
import { useEffect } from 'react'; | ||
|
||
export function BadComponent(props) { | ||
if (props.name) { | ||
useEffect(() => {}); | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
packages/modular-scripts/src/__tests__/__fixtures__/lint/InvalidTS.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
//@ts-nocheck | ||
/* eslint-disable */ | ||
|
||
interface Props {} | ||
|
||
export function funcHasNoType(props: Props) { | ||
const type: any = ''; | ||
|
||
if (type) { | ||
} else { | ||
} | ||
|
||
const emptyFunc = () => {}; | ||
} |
12 changes: 12 additions & 0 deletions
12
packages/modular-scripts/src/__tests__/__fixtures__/lint/InvalidTSX.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
//@ts-nocheck | ||
/* eslint-disable */ | ||
|
||
import { useEffect } from 'react'; | ||
|
||
export function BadComponent(props) { | ||
if (props.name) { | ||
useEffect(function logMe() { | ||
console.log('Me!'); | ||
}); | ||
} | ||
} |
Oops, something went wrong.