Skip to content

Commit

Permalink
Merge pull request #302 from noaignite/feat/eslint-config-allow-dev-d…
Browse files Browse the repository at this point in the history
…eps-in-tsup-config

feat(eslint-config): allow dev deps in tsup config
  • Loading branch information
maeertin authored Oct 23, 2024
2 parents c859e77 + a2ab51e commit 780327a
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 15 deletions.
2 changes: 2 additions & 0 deletions .changeset/strong-boxes-heal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
7 changes: 5 additions & 2 deletions packages/create-app/template-eslint-config/library.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,14 @@ module.exports = {
'import/no-extraneous-dependencies': [
'error',
{
// Allow imports of `devDependencies` inside test files.
// Allow imports of `devDependencies` inside certain files.
devDependencies: [
'test.{ts,tsx}', // repos with a single test file
'test-*.{ts,tsx}', // repos with multiple top-level test files
'**/*{.,_}{test,spec}.{ts,tsx}', // tests where the extension or filename suffix denotes that it is a test
'**/vitest.config.mts', // vitest config
'**/scripts/**/*.{mts,ts,tsx}', // script files
'**/tsup.config.{mts,ts,tsx}', // tsup files
'**/vitest.config.{mts,ts,tsx}', // vitest files
],
optionalDependencies: false,
},
Expand All @@ -58,5 +60,6 @@ module.exports = {

'lines-around-directive': ['error', 'always'], // Enable & let prettier format.
'no-console': ['error', { allow: ['info', 'warn', 'error'] }], // Allow warn and error logs.
'prefer-named-capture-group': 'off', // Too strict.
},
}
7 changes: 5 additions & 2 deletions packages/create-app/template-eslint-config/next.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,14 @@ module.exports = {
'import/no-extraneous-dependencies': [
'error',
{
// Allow imports of `devDependencies` inside test files.
// Allow imports of `devDependencies` inside certain files.
devDependencies: [
'test.{ts,tsx}', // repos with a single test file
'test-*.{ts,tsx}', // repos with multiple top-level test files
'**/*{.,_}{test,spec}.{ts,tsx}', // tests where the extension or filename suffix denotes that it is a test
'**/vitest.config.mts', // vitest config
'**/scripts/**/*.{mts,ts,tsx}', // script files
'**/tsup.config.{mts,ts,tsx}', // tsup files
'**/vitest.config.{mts,ts,tsx}', // vitest files
],
optionalDependencies: false,
},
Expand All @@ -67,5 +69,6 @@ module.exports = {

'lines-around-directive': ['error', 'always'], // Enable & let prettier format.
'no-console': ['error', { allow: ['info', 'warn', 'error'] }], // Allow warn and error logs.
'prefer-named-capture-group': 'off', // Too strict.
},
}
7 changes: 5 additions & 2 deletions packages/create-app/template-eslint-config/react.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,14 @@ module.exports = {
'import/no-extraneous-dependencies': [
'error',
{
// Allow imports of `devDependencies` inside test files.
// Allow imports of `devDependencies` inside certain files.
devDependencies: [
'test.{ts,tsx}', // repos with a single test file
'test-*.{ts,tsx}', // repos with multiple top-level test files
'**/*{.,_}{test,spec}.{ts,tsx}', // tests where the extension or filename suffix denotes that it is a test
'**/vitest.config.mts', // vitest config
'**/scripts/**/*.{mts,ts,tsx}', // script files
'**/tsup.config.{mts,ts,tsx}', // tsup files
'**/vitest.config.{mts,ts,tsx}', // vitest files
],
optionalDependencies: false,
},
Expand All @@ -64,6 +66,7 @@ module.exports = {

'lines-around-directive': ['error', 'always'], // Enable & let prettier format.
'no-console': ['error', { allow: ['info', 'warn', 'error'] }], // Allow warn and error logs.
'prefer-named-capture-group': 'off', // Too strict.
},
overrides: [
{
Expand Down
7 changes: 4 additions & 3 deletions packages/eslint-config/library.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,14 @@ module.exports = {
'import/no-extraneous-dependencies': [
'error',
{
// Allow imports of `devDependencies` inside test files.
// Allow imports of `devDependencies` inside certain files.
devDependencies: [
'test.{ts,tsx}', // repos with a single test file
'test-*.{ts,tsx}', // repos with multiple top-level test files
'**/*{.,_}{test,spec}.{ts,tsx}', // tests where the extension or filename suffix denotes that it is a test
'**/vitest.config.mts', // vitest config
'**/scripts/**/*.{ts,tsx}', // build script files
'**/scripts/**/*.{mts,ts,tsx}', // script files
'**/tsup.config.{mts,ts,tsx}', // tsup files
'**/vitest.config.{mts,ts,tsx}', // vitest files
],
optionalDependencies: false,
},
Expand Down
7 changes: 4 additions & 3 deletions packages/eslint-config/next.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,14 @@ module.exports = {
'import/no-extraneous-dependencies': [
'error',
{
// Allow imports of `devDependencies` inside test files.
// Allow imports of `devDependencies` inside certain files.
devDependencies: [
'test.{ts,tsx}', // repos with a single test file
'test-*.{ts,tsx}', // repos with multiple top-level test files
'**/*{.,_}{test,spec}.{ts,tsx}', // tests where the extension or filename suffix denotes that it is a test
'**/vitest.config.mts', // vitest config
'**/scripts/**/*.{ts,tsx}', // build script files
'**/scripts/**/*.{mts,ts,tsx}', // script files
'**/tsup.config.{mts,ts,tsx}', // tsup files
'**/vitest.config.{mts,ts,tsx}', // vitest files
],
optionalDependencies: false,
},
Expand Down
7 changes: 4 additions & 3 deletions packages/eslint-config/react.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,14 @@ module.exports = {
'import/no-extraneous-dependencies': [
'error',
{
// Allow imports of `devDependencies` inside test files.
// Allow imports of `devDependencies` inside certain files.
devDependencies: [
'test.{ts,tsx}', // repos with a single test file
'test-*.{ts,tsx}', // repos with multiple top-level test files
'**/*{.,_}{test,spec}.{ts,tsx}', // tests where the extension or filename suffix denotes that it is a test
'**/vitest.config.mts', // vitest config
'**/scripts/**/*.{ts,tsx}', // build script files
'**/scripts/**/*.{mts,ts,tsx}', // script files
'**/tsup.config.{mts,ts,tsx}', // tsup files
'**/vitest.config.{mts,ts,tsx}', // vitest files
],
optionalDependencies: false,
},
Expand Down

0 comments on commit 780327a

Please sign in to comment.