Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

feat: added eslintingore template and PWA options #839

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/cna-template/template/_.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<%_ if (pwa) { _%>
# Service worker
sw.*
<%_ } _%>
2 changes: 2 additions & 0 deletions packages/create-nuxt-app/lib/saofile.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ module.exports = {
files: '*',
filters: {
'_.eslintrc.js': 'linter.includes("eslint")',
'_.eslintignore': 'linter.includes("eslint")',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of adding another file, can't you add sw.js in gitingore?

Cause there are cases where we use prettier, style lint alongside eslint. This approach would also mean that you have to add .prettierignore & .stylelintignore

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When the files are generated, sw.* is included in the .gitignore already. Although, eslint still runs through and lints the auto generated service worker codes causing the linting error when developing or building.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error. @typescript-eslint is whats emitting the error.

Screen Shot 2021-08-25 at 3 26 44 AM

This disappears when sw.* is included in the .eslintignore

'_.prettierrc': 'linter.includes("prettier")',
'_jsconfig.json': 'devTools.includes("jsconfig.json")',
'tsconfig.json': 'language.includes("ts")',
Expand All @@ -121,6 +122,7 @@ module.exports = {
'_package.json': 'package.json',
'_.prettierrc': '.prettierrc',
'_.eslintrc.js': '.eslintrc.js',
'_.eslintignore': '.eslintignore',
'_jsconfig.json': 'jsconfig.json',
'_stylelint.config.js': 'stylelint.config.js',
'_commitlint.config.js': 'commitlint.config.js',
Expand Down
2 changes: 2 additions & 0 deletions packages/create-nuxt-app/test/snapshots/index.test.js.md
Original file line number Diff line number Diff line change
Expand Up @@ -2063,6 +2063,7 @@ Generated by [AVA](https://avajs.dev).

[
'.editorconfig',
'.eslintignore',
'.eslintrc.js',
'.gitignore',
'.husky/.gitignore',
Expand Down Expand Up @@ -2179,6 +2180,7 @@ Generated by [AVA](https://avajs.dev).

[
'.editorconfig',
'.eslintignore',
'.eslintrc.js',
'.gitignore',
'README.md',
Expand Down
Binary file modified packages/create-nuxt-app/test/snapshots/index.test.js.snap
Binary file not shown.