Skip to content

Commit

Permalink
feat: treat all source files in test subdirectories as automated tests
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Source files in subdirectories named "test" are now treated as automated tests.
  • Loading branch information
djcsdy committed Nov 9, 2021
1 parent b2de09c commit f2346be
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,8 @@ const config: Linter.Config = {
},
{
files: [
"test/**/*.ts",
"test/**/*.tsx",
"test.ts",
"test.tsx",
"*.test.ts",
Expand All @@ -270,7 +272,12 @@ const config: Linter.Config = {
}
},
{
files: ["test.{js,jsx,ts,tsx}", "*.test.{js,jsx,ts,tsx}", "*.config.{js,jsx,ts,tsx}"],
files: [
"test/**/*.{js,jsx,ts,tsx}",
"test.{js,jsx,ts,tsx}",
"*.test.{js,jsx,ts,tsx}",
"*.config.{js,jsx,ts,tsx}"
],
rules: {
"no-restricted-imports": "off"
}
Expand All @@ -291,6 +298,7 @@ const config: Linter.Config = {
"error",
{
devDependencies: [
"**/test/**/*.{js,jsx,ts,tsx}",
"**/*.config.{js,jsx,ts,tsx}",
"**/*.test.{js,jsx,ts,tsx}",
"**/*.test-d.{ts,tsx}",
Expand Down Expand Up @@ -332,6 +340,7 @@ const config: Linter.Config = {
"error",
{
patterns: [
"**/test/**/*{,.js,.jsx,.ts,.tsx}",
"**/*.config{,.js,.jsx,.ts,.tsx}",
"**/*.test{,.js,.jsx,.ts,.tsx}",
"**/test{,.js,.jsx,.ts,.tsx}"
Expand Down

0 comments on commit f2346be

Please sign in to comment.