-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: migrate eslint config to esm (#1410)
- Loading branch information
Showing
36 changed files
with
1,464 additions
and
1,297 deletions.
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
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 +1 @@ | ||
module.exports = require('../../eslint.config') | ||
export { default } from '@mach/shared-eslint-config' |
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,5 +1,6 @@ | ||
{ | ||
"name": "@mach/rpl-crawler-cli", | ||
"type": "module", | ||
"scripts": { | ||
"lint": "eslint .", | ||
"pack": "vite build", | ||
|
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,6 +1,6 @@ | ||
const eslintPluginPlaywright = require('eslint-plugin-playwright') | ||
// @ts-check | ||
|
||
module.exports = [ | ||
...require('../../eslint.config'), | ||
eslintPluginPlaywright.configs['flat/recommended'], | ||
] | ||
import playwright from 'eslint-plugin-playwright' | ||
import defaultConfigs from '../../eslint.config.js' | ||
|
||
export default [...defaultConfigs, playwright.configs['flat/recommended']] |
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,5 +1,6 @@ | ||
{ | ||
"name": "@mach/web-e2e", | ||
"type": "module", | ||
"dependencies": { | ||
"@mach/shared-database": "workspace:*" | ||
}, | ||
|
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 was deleted.
Oops, something went wrong.
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 @@ | ||
export { default } from '@mach/shared-eslint-config' |
File renamed without changes.
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,45 +1 @@ | ||
const eslint = require('@eslint/js') | ||
const tsEslint = require('typescript-eslint') | ||
const reactEslint = require('eslint-plugin-react/configs/recommended') | ||
const nxEslint = require('@nx/eslint-plugin') | ||
|
||
module.exports = tsEslint.config( | ||
eslint.configs.recommended, | ||
...tsEslint.configs.recommended, | ||
{ | ||
...reactEslint, | ||
rules: { | ||
...reactEslint.rules, | ||
'react/react-in-jsx-scope': 'off', | ||
'react/jsx-no-target-blank': 'off', | ||
}, | ||
}, | ||
{ | ||
plugins: { | ||
'@nx': nxEslint, | ||
}, | ||
rules: { | ||
'@nx/enforce-module-boundaries': [ | ||
'error', | ||
{ | ||
allow: [], | ||
depConstraints: [ | ||
{ | ||
sourceTag: '*', | ||
onlyDependOnLibsWithTags: ['*'], | ||
}, | ||
{ | ||
sourceTag: 'type:feature', | ||
onlyDependOnLibsWithTags: ['type:shared'], | ||
}, | ||
{ | ||
sourceTag: 'type:shared', | ||
onlyDependOnLibsWithTags: ['type:shared'], | ||
}, | ||
], | ||
}, | ||
], | ||
}, | ||
}, | ||
{ ignores: ['**/eslint.config.js', '**/eslint.config.cjs', '**/dist'] } | ||
) | ||
export { default } from '@mach/shared-eslint-config' |
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 +1 @@ | ||
module.exports = require('../../eslint.config') | ||
export { default } from '@mach/shared-eslint-config' |
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
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,21 @@ | ||
class Logger { | ||
private static formatMessage(level: LoggingLevel, message: string): string { | ||
return `${new Date().toISOString()} - [${level}] - ${message}` | ||
} | ||
function formatMessage(level: LoggingLevel, message: string): string { | ||
return `${new Date().toISOString()} - [${level}] - ${message}` | ||
} | ||
|
||
public static info(message: string): void { | ||
console.info(Logger.formatMessage(LoggingLevel.INFO, message)) | ||
} | ||
export function info(message: string): void { | ||
console.info(formatMessage(LoggingLevel.INFO, message)) | ||
} | ||
|
||
public static error(error: Error): void { | ||
console.error( | ||
`${Logger.formatMessage( | ||
LoggingLevel.ERROR, | ||
error.message | ||
)} - ${JSON.stringify(error)}` | ||
) | ||
} | ||
export function error(error: Error): void { | ||
console.error( | ||
`${formatMessage( | ||
LoggingLevel.ERROR, | ||
error.message | ||
)} - ${JSON.stringify(error)}` | ||
) | ||
} | ||
|
||
enum LoggingLevel { | ||
INFO = 'INFO', | ||
ERROR = 'ERROR', | ||
} | ||
|
||
export default Logger |
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 +1 @@ | ||
module.exports = require('../../eslint.config') | ||
export { default } from '@mach/shared-eslint-config' |
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,54 @@ | ||
// @ts-check | ||
|
||
import eslint from '@eslint/js' | ||
import nxPlugin from '@nx/eslint-plugin' | ||
import reactPlugin from 'eslint-plugin-react' | ||
import tseslint from 'typescript-eslint' | ||
|
||
export default tseslint.config( | ||
eslint.configs.recommended, | ||
...tseslint.configs.strict, | ||
...tseslint.configs.stylistic, | ||
{ | ||
rules: { | ||
'@typescript-eslint/consistent-type-definitions': ['error', 'type'], | ||
}, | ||
}, | ||
reactPlugin.configs.flat.recommended, | ||
{ | ||
settings: { | ||
react: { | ||
version: '18.3.1', | ||
}, | ||
}, | ||
}, | ||
reactPlugin.configs.flat['jsx-runtime'], | ||
{ plugins: { '@nx': nxPlugin } }, | ||
{ | ||
files: ['*.ts', '*.tsx', '*.js', '*.jsx'], | ||
|
||
rules: { | ||
'@nx/enforce-module-boundaries': [ | ||
'error', | ||
{ | ||
allow: [], | ||
depConstraints: [ | ||
{ | ||
sourceTag: '*', | ||
onlyDependOnLibsWithTags: ['*'], | ||
}, | ||
{ | ||
sourceTag: 'type:feature', | ||
onlyDependOnLibsWithTags: ['type:shared'], | ||
}, | ||
{ | ||
sourceTag: 'type:shared', | ||
onlyDependOnLibsWithTags: ['type:shared'], | ||
}, | ||
], | ||
}, | ||
], | ||
}, | ||
}, | ||
{ ignores: ['**/eslint.config.js', '**/dist'] } | ||
) |
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 @@ | ||
{ | ||
"name": "@mach/shared-eslint-config", | ||
"type": "module", | ||
"main": "eslint.config.js", | ||
"devDependencies": { | ||
"@eslint/js": "~9.13.0", | ||
"@nx/eslint-plugin": "20.0.12", | ||
"eslint": "^9.14.0", | ||
"eslint-plugin-import": "2.31.0", | ||
"eslint-plugin-jsx-a11y": "6.10.0", | ||
"eslint-plugin-playwright": "^2.0.0", | ||
"eslint-plugin-react": "^7.37.1", | ||
"eslint-plugin-react-hooks": "5.0.0", | ||
"typescript-eslint": "^8.10.0" | ||
} | ||
} |
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 +1 @@ | ||
module.exports = require('../../eslint.config') | ||
export { default } from '@mach/shared-eslint-config' |
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
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 +1 @@ | ||
module.exports = require('../../eslint.config') | ||
export { default } from '@mach/shared-eslint-config' |
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 +1 @@ | ||
module.exports = require('../../eslint.config') | ||
export { default } from '@mach/shared-eslint-config' |
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 was deleted.
Oops, something went wrong.
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 @@ | ||
export { default } from '@mach/shared-eslint-config' |
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
Oops, something went wrong.