-
Notifications
You must be signed in to change notification settings - Fork 2
eslint fixes #1317
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
eslint fixes #1317
Changes from 4 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,38 +1,47 @@ | ||
| import guardian from '@guardian/eslint-config'; | ||
| import globals from 'globals'; | ||
|
|
||
| export default [ | ||
| { | ||
| ignores: [ | ||
| 'node_modules', | ||
| 'dist', | ||
| 'server-dist', | ||
|
|
||
| 'customize.js', | ||
| 'rollup.config.js', | ||
| 'webpack.*js', | ||
| ], | ||
| }, | ||
| ...guardian.configs.recommended, | ||
| ...guardian.configs.jest, | ||
| { | ||
| ignores: ['eslint.config.mjs'], | ||
| languageOptions: { | ||
|
Member
Author
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. this section heavily inspired by https://github.com/guardian/commercial/blob/main/eslint.config.mjs#L16 |
||
| globals: { | ||
| ...globals.jest, | ||
| ...globals.browser, | ||
| ...globals.node, | ||
| }, | ||
| ecmaVersion: 5, | ||
| sourceType: 'commonjs', | ||
| parserOptions: { | ||
| project: ['./tsconfig.json'], | ||
| tsconfigRootDir: './', | ||
| }, | ||
| }, | ||
| rules: { | ||
| // Place to specify ESLint rules. Can be used to overwrite rules specified from the extended configs | ||
| // e.g. "@typescript-eslint/explicit-function-return-type": "off", | ||
| curly: 2, | ||
| '@typescript-eslint/no-inferrable-types': [ | ||
|
Member
Author
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. this was causing an error, but I think it's no longer needed anyway |
||
| 'error', | ||
| { | ||
| ignoreParameters: true, | ||
| }, | ||
| ], | ||
| '@typescript-eslint/no-unused-vars': [ | ||
| 'error', | ||
| { | ||
| args: 'after-used', | ||
| ignoreRestSiblings: true, | ||
| }, | ||
| ], | ||
| // '@typescript-eslint/no-unused-vars': [ | ||
|
Member
Author
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. we've temporarily added a more general "off" for this rule below |
||
| // 'error', | ||
| // { | ||
| // args: 'after-used', | ||
| // ignoreRestSiblings: true, | ||
| // }, | ||
| // ], | ||
|
|
||
| // potentially to fix later see https://trello.com/c/lc8lG7Zj | ||
| // potentially to fix later see https://trello.com/c/lc8lG7Zj | ||
| '@typescript-eslint/naming-convention': 'off', | ||
| '@eslint-community/eslint-comments/require-description': 'off', | ||
| '@typescript-eslint/ban-types': 'off', | ||
|
|
@@ -44,7 +53,6 @@ export default [ | |
| '@typescript-eslint/require-await': 'off', | ||
| '@typescript-eslint/no-unsafe-enum-comparison': 'off', | ||
| '@typescript-eslint/no-unsafe-argument': 'off', | ||
| '@typescript-eslint/no-unnecessary-condition': 'off', | ||
| '@typescript-eslint/no-unsafe-return': 'off', | ||
| '@typescript-eslint/no-base-to-string': 'off', | ||
| '@typescript-eslint/prefer-promise-reject-errors': 'off', | ||
|
|
@@ -53,6 +61,8 @@ export default [ | |
| '@typescript-eslint/no-unused-vars': 'off', | ||
| '@typescript-eslint/restrict-template-expressions': 'off', | ||
| '@typescript-eslint/no-floating-promises': 'off', | ||
| '@typescript-eslint/prefer-optional-chain': 'off', | ||
| '@typescript-eslint/await-thenable': 'off', | ||
| }, | ||
| }, | ||
| ]; | ||
| ]; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,7 +21,7 @@ | |
| "build-dotcom-types": "tsc --project tsconfig.types.json", | ||
| "publish-dry-run": "pnpm publish --dry-run", | ||
| "publish": "pnpm publish", | ||
| "lint": "eslint 'src/**/*.{ts,tsx}'", | ||
|
Member
Author
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. no need to specify the path here |
||
| "lint": "eslint .", | ||
| "test": "export stage=DEV; jest", | ||
| "riffraff": "node-riffraff-artifact" | ||
| }, | ||
|
|
@@ -52,6 +52,7 @@ | |
| "eslint-plugin-prettier": "5.1.3", | ||
| "eslint-plugin-react": "^7.33.2", | ||
| "fishery": "^0.3.0", | ||
| "globals": "15.14.0", | ||
| "inquirer": "^7.0.3", | ||
| "jest": "^29.7.0", | ||
| "nodemon": "^3.1.7", | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,3 @@ | ||
| export { getEpicViewLog, logEpicView } from '../shared/lib/viewLog'; | ||
|
Member
Author
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. we export all of |
||
| export { getWeeklyArticleHistory, incrementWeeklyArticleCount } from '../shared/lib/history'; | ||
| export { | ||
| replaceNonArticleCountPlaceholders, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| import { | ||
| import type { | ||
| GutterTargeting, | ||
| GutterTest, | ||
| GutterTestSelection, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| import { | ||
| import type { | ||
| HeaderTargeting, | ||
| HeaderTest, | ||
| HeaderTestSelection, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,7 +7,6 @@ | |
| "sourceMap": true, | ||
| "strict": true | ||
| }, | ||
| "files": ["src/server/server.ts"], | ||
| "include": [], | ||
| "include": ["src"], | ||
|
Member
Author
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. this fixes the "not found" errors, e.g. |
||
| "exclude": ["node_modules"] | ||
| } | ||
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.
it fails to parse this file because we have
sourceType: 'commonjs'