-
Notifications
You must be signed in to change notification settings - Fork 1
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
Fix config and update examples #41
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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 @@ | ||
--- | ||
'eslint-config-widen': patch | ||
--- | ||
|
||
Fix config and update examples. |
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/** @type {import('@jest/types').Config.ProjectConfig} */ | ||
module.exports = { | ||
testPathIgnorePatterns: ['<rootDir>/packages/eslint-playground/'], | ||
} |
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
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,25 +1,7 @@ | ||
// index.js or index.mjs inside eslint-config-widen package | ||
import { Linter } from 'eslint' | ||
import baseConfig from './index.js' | ||
import jestConfig from './jest.js' | ||
import playwrightConfig from './playwright.js' | ||
import reactConfig from './react.js' | ||
import typescriptConfig from './typescript.js' | ||
import base from './base.js' | ||
import jest from './jest.js' | ||
import playwright from './playwright.js' | ||
import react from './react.js' | ||
import typescript from './typescript.js' | ||
|
||
export interface EslintConfig { | ||
base: Linter.FlatConfig[] | ||
typescript: Linter.FlatConfig[] | ||
react: Linter.FlatConfig[] | ||
playwright: Linter.FlatConfig[] | ||
jest: Linter.FlatConfig[] | ||
} | ||
|
||
const configs = { | ||
base: baseConfig, | ||
jest: jestConfig, | ||
playwright: playwrightConfig, | ||
react: reactConfig, | ||
typescript: typescriptConfig, | ||
} as unknown as EslintConfig | ||
|
||
export default configs | ||
export { base, jest, playwright, react, typescript } |
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import globals from 'globals' | ||
|
||
// delete an invalid global that causes error because of the trailing space | ||
const browser = globals.browser | ||
delete browser['AudioWorkletGlobalScope '] | ||
|
||
const sharedGlobals = { | ||
...browser, | ||
...globals.es6, | ||
...globals.node, | ||
...globals.jest, | ||
} | ||
|
||
export default sharedGlobals |
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
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,11 @@ | ||
# eslint-playground | ||
|
||
A sample project that uses the eslint-config-widen to ensure things are working. | ||
Included is a file to correspond with each eslint plugin type which will throw | ||
lint errors. | ||
|
||
### To test updates: | ||
|
||
1. Run `yarn ts` in the base package any time you change the code in the | ||
eslint-config-widen to regen the output. | ||
2. In the eslint-playground package run `yarn lint` |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice! |
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,11 @@ | ||
import { expect, test } from 'fixtures' | ||
|
||
/** | ||
* Basic test with errors to test playwright eslint config | ||
*/ | ||
test.describe('Sample', () => { | ||
test('should pass', async ({ page }) => { | ||
console.log('wow') | ||
await page.goto('https://playwright.dev/') | ||
}) | ||
}) |
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,16 @@ | ||
import { base, react, jest, playwright, typescript } from 'eslint-config-widen' | ||
|
||
export default [ | ||
...base, | ||
...typescript, | ||
...react, | ||
...[ | ||
// you can specify what to ignore by using the `ignores` key before any other rule | ||
// this will filter out things we dont want this to run on | ||
{ ignores: ['*.test.*'] }, | ||
...jest, | ||
// you can also override rules by specifying the rule and the new value | ||
{ files: ['*.spec.js'], rules: { 'jest/expect-expect': 'off' } }, | ||
], | ||
...[{ files: ['e2e/**'] }, ...playwright], | ||
] |
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,6 @@ | ||
/** | ||
* Empty test to test jest eslint config errors | ||
*/ | ||
it('should render', async () => { | ||
console.log('hey') | ||
}) |
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,10 @@ | ||
/** | ||
* contains some failing rules to test base eslint config | ||
*/ | ||
export function test(input = 'test', hey) { | ||
try { | ||
console.log('test') | ||
} catch (e) { | ||
throw e | ||
} | ||
} |
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,24 @@ | ||
{ | ||
"name": "eslint-playground", | ||
"packageManager": "[email protected]", | ||
"scripts": { | ||
"lint": "eslint ." | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "^7.24.8", | ||
"@babel/eslint-parser": "^7.24.8", | ||
"eslint": "^9.6.0", | ||
"eslint-config-widen": "workspace:^", | ||
"eslint-plugin-jest": "^28.6.0", | ||
"eslint-plugin-jsx-a11y": "^6.9.0", | ||
"eslint-plugin-playwright": "^1.6.2", | ||
"eslint-plugin-prettier": "^5.1.3", | ||
"eslint-plugin-react": "^7.34.3", | ||
"eslint-plugin-react-hooks": "^4.6.2", | ||
"eslint-plugin-sort": "^3.0.2", | ||
"eslint-plugin-widen": "workspace:^" | ||
}, | ||
"dependencies": { | ||
"react": "^18.3.1" | ||
} | ||
} |
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,6 @@ | ||
import React from 'react' | ||
|
||
export function test(unused, unused) { | ||
console.log('wow') | ||
return <button>Test</button> | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does this mean? Why does whatever AudioWorklet is have an extra space?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great question, I don't know. I assume it was saved incorrectly in globals.