Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

fix: add eslint.config.* to tsconfig.node.json and fix other eslint issues #669

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jan 20, 2025
Merged
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
2 changes: 1 addition & 1 deletion 2 .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
- pnpm --filter '!*typescript*' build
- pnpm --filter '*typescript*' build
- pnpm --filter '*vitest*' test:unit
- pnpm --filter '*eslint*' lint --no-fix --max-warnings=0
- pnpm --filter '*eslint*' --filter '!*nightwatch*' lint --no-fix --max-warnings=0
- pnpm --filter '*prettier*' format --write --check
# FIXME: it's failing now
# - pnpm --filter '*with-tests*' test:unit
Expand Down
5 changes: 5 additions & 0 deletions 5 __test__/renderEslint.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { getAdditionalConfigs } from '../utils/renderEslint'
describe('renderEslint', () => {
it('should get additional dependencies and config with no test flags', () => {
const additionalConfigs = getAdditionalConfigs({
needsTypeScript: false,
needsVitest: false,
needsCypress: false,
needsCypressCT: false,
Expand All @@ -14,6 +15,7 @@ describe('renderEslint', () => {

it('should get additional dependencies and config with for vitest', () => {
const additionalConfigs = getAdditionalConfigs({
needsTypeScript: false,
needsVitest: true,
needsCypress: false,
needsCypressCT: false,
Expand All @@ -31,6 +33,7 @@ describe('renderEslint', () => {

it('should get additional dependencies and config with for cypress', () => {
const additionalConfigs = getAdditionalConfigs({
needsTypeScript: false,
needsVitest: false,
needsCypress: true,
needsCypressCT: false,
Expand All @@ -53,6 +56,7 @@ describe('renderEslint', () => {

it('should get additional dependencies and config with for cypress with component testing', () => {
const additionalConfigs = getAdditionalConfigs({
needsTypeScript: false,
needsVitest: false,
needsCypress: true,
needsCypressCT: true,
Expand All @@ -76,6 +80,7 @@ describe('renderEslint', () => {

it('should get additional dependencies and config with for playwright', () => {
const additionalConfigs = getAdditionalConfigs({
needsTypeScript: false,
needsVitest: false,
needsCypress: false,
needsCypressCT: false,
Expand Down
3 changes: 2 additions & 1 deletion 3 scripts/snapshot.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const featureFlags = [
'cypress',
'playwright',
'nightwatch',
'eslint',
]
const featureFlagsDenylist = [
['cypress', 'playwright'],
Expand Down Expand Up @@ -55,7 +56,7 @@ function fullCombination(arr) {
}

let flagCombinations = fullCombination(featureFlags)
flagCombinations.push(['default'], ['bare', 'default'], ['eslint'], ['eslint-with-prettier'])
flagCombinations.push(['default'], ['bare', 'default'], ['eslint-with-prettier'])

// `--with-tests` are equivalent of `--vitest --cypress`
// Previously it means `--cypress` without `--vitest`.
Expand Down
3 changes: 2 additions & 1 deletion 3 template/tsconfig/base/tsconfig.node.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"vitest.config.*",
"cypress.config.*",
"nightwatch.conf.*",
"playwright.config.*"
"playwright.config.*",
"eslint.config.*"
],
"compilerOptions": {
"noEmit": true,
Expand Down
10 changes: 8 additions & 2 deletions 10 utils/renderEslint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export default function renderEslint(
},
) {
const additionalConfigs = getAdditionalConfigs({
needsTypeScript,
needsVitest,
needsCypress,
needsCypressCT,
Expand Down Expand Up @@ -64,6 +65,7 @@ type AdditionalConfigArray = Array<AdditionalConfig>

// visible for testing
export function getAdditionalConfigs({
needsTypeScript,
needsVitest,
needsCypress,
needsCypressCT,
Expand Down Expand Up @@ -96,13 +98,17 @@ export function getAdditionalConfigs({
},
afterVuePlugin: [
{
importer: "import pluginCypress from 'eslint-plugin-cypress/flat'",
importer:
(needsTypeScript
? `// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n` +
`// @ts-ignore\n`
: '') + "import pluginCypress from 'eslint-plugin-cypress/flat'",
content: `
{
...pluginCypress.configs.recommended,
files: [
${[
...(needsCypressCT ? ["'**/__tests__/*.{cy,spec}.{js,ts,jsx,tsx}',"] : []),
...(needsCypressCT ? ['**/__tests__/*.{cy,spec}.{js,ts,jsx,tsx}'] : []),
'cypress/e2e/**/*.{cy,spec}.{js,ts,jsx,tsx}',
'cypress/support/**/*.{js,ts,jsx,tsx}',
]
Expand Down
Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.