-
Notifications
You must be signed in to change notification settings - Fork 583
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* this is great! * try ci * class components * unmock * works * hm * this * move stuff around * Delete betterer-check.yml * strictness * cache and sort * ci * not now * fixed * Update .circleci/config.yml
- Loading branch information
Showing
20 changed files
with
3,075 additions
and
955 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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,48 @@ | ||
import { regexp } from "@betterer/regexp" | ||
import { BettererFileTest } from "@betterer/betterer" | ||
|
||
const typescriptFiles = ["./src/**/*.ts", "./src/**/*.tsx"] | ||
const typescriptTestFiles = ["./src/**/*.tests.ts", "./src/**/*.tests.tsx"] | ||
const imageExtensionsToAvoid = ["png", "jpg", "jpeg"] | ||
|
||
export default { | ||
"Stop using useAnimatedValue, use useSharedValue instead!": () => | ||
regexp(/useAnimatedValue\(/).include(typescriptFiles), | ||
|
||
"Stop using moment, use luxon instead!": () => | ||
regexp(/from "(moment|moment-timezone)"/).include(typescriptFiles), | ||
|
||
"Finish our strictnes migration!": () => | ||
regexp(/Unsafe legacy code 🚨 Please delete this/).include(typescriptFiles), | ||
|
||
// "Avoid non-webp images!": () => | ||
// countNonWebpImages().include([`./images/**/*.{${imageExtensionsToAvoid.join(",")}}`]), | ||
|
||
"Avoid using test-renderer!": () => | ||
regexp(/renderWithWrappersLEGACY.* from ".*renderWithWrappers"/).include(typescriptTestFiles), | ||
|
||
"Remove all relay unmocks!": () => regexp(/unmock\("react-relay"\)/).include(typescriptTestFiles), | ||
|
||
"Fix all STRICTNESS_MIGRATION!": () => regexp(/STRICTNESS_MIGRATION/).include(typescriptFiles), | ||
|
||
"Avoid having skipped tests!": () => | ||
regexp(/(fdescribe\(|describe.only\(|fit\(|xit\(|it.only\(|it.skip\()/).include( | ||
typescriptTestFiles | ||
), | ||
|
||
"Avoid using class components!": () => | ||
regexp(/extends (React\.)?Component/).include(typescriptFiles), | ||
} | ||
|
||
// const countNonWebpImages = () => | ||
// new BettererFileTest(async (filePaths, fileTestResult) => { | ||
// filePaths.forEach((filePath) => { | ||
// // the file contents don't matter | ||
// const file = fileTestResult.addFile(filePath, "") | ||
// file.addIssue( | ||
// 0, | ||
// 0, | ||
// "don't use non-webp images. you can use the script to convert other formats to webp." | ||
// ) | ||
// }) | ||
// }) |
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 |
---|---|---|
|
@@ -3,4 +3,3 @@ | |
|
||
|
||
yarn lint-staged | ||
yarn secrets:check:staged |
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 |
---|---|---|
|
@@ -3,3 +3,4 @@ | |
|
||
|
||
yarn type-check | ||
yarn betterer:all |
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,5 @@ | ||
export default { | ||
"*.@(ts|tsx)": ["yarn lint", "yarn prettier-write"], | ||
"*.@(json|md)": ["yarn prettier-write"], | ||
"*": ["yarn secrets:check:staged", "yarn betterer:precommit"], | ||
} |
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 @@ | ||
module.exports = { | ||
printWidth: 100, | ||
semi: false, | ||
singleQuote: false, | ||
trailingComma: "es5", | ||
bracketSpacing: true, | ||
} |
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,6 +1,10 @@ | ||
{ | ||
// See http://go.microsoft.com/fwlink/?LinkId=827846 | ||
// for the documentation about the extensions.json format | ||
"recommendations": ["Orta.vscode-ios-common-files", "Orta.vscode-danger", "artsy.artsy-studio-extension-pack", "meta.relay"], | ||
"recommendations": [ | ||
"Orta.vscode-ios-common-files", | ||
"artsy.artsy-studio-extension-pack", | ||
"meta.relay" | ||
], | ||
"unwantedRecommendations": ["prisma.vscode-graphql"] | ||
} |
This file was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
Oops, something went wrong.