-
Notifications
You must be signed in to change notification settings - Fork 1
ci(lint): expand scripts and config lint coverage #115
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
Changes from all 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 |
|---|---|---|
|
|
@@ -20,7 +20,6 @@ module.exports = [ | |
| 'dist/**', | ||
| 'build/**', | ||
| 'coverage/**', | ||
| 'scripts/**', | ||
| 'src/renderer/bundle.js', | ||
| 'src/renderer/bundle.js.map', | ||
| 'src/renderer/bundle.js.LICENSE.txt', | ||
|
|
@@ -31,6 +30,36 @@ module.exports = [ | |
| ], | ||
| }, | ||
| js.configs.recommended, | ||
| { | ||
| files: [ | ||
| 'scripts/**/*.js', | ||
| '*.config.js', | ||
| 'eslint.config.js', | ||
| '.eslintrc.js', | ||
| '.babelrc.js', | ||
| 'tests/.eslintrc.js', | ||
| ], | ||
| languageOptions: { | ||
| ecmaVersion: 2022, | ||
| sourceType: 'commonjs', | ||
| globals: { | ||
| ...globals.node, | ||
| }, | ||
| }, | ||
| rules: { | ||
| 'no-unused-vars': 'off', | ||
| 'no-case-declarations': 'off', | ||
| 'no-useless-escape': 'off', | ||
| }, | ||
|
Comment on lines
+49
to
+53
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. Disabling these core ESLint rules is generally discouraged as it can hide potential bugs and reduce code quality.
If these rules were disabled to facilitate the initial rollout of linting for these files, it would be beneficial to create a follow-up ticket to address the reported issues and re-enable these rules. |
||
| }, | ||
| { | ||
| files: ['scripts/capture-ui-screenshot.js'], | ||
| languageOptions: { | ||
| globals: { | ||
| ...globals.browser, | ||
| }, | ||
| }, | ||
| }, | ||
| { | ||
| files: ['src/**/*.{js,jsx,ts,tsx}', 'tests/**/*.{js,jsx,ts,tsx}'], | ||
| languageOptions: { | ||
|
|
@@ -58,7 +87,16 @@ module.exports = [ | |
| 'import/order': [ | ||
| 'error', | ||
| { | ||
| groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index', 'object', 'type'], | ||
| groups: [ | ||
| 'builtin', | ||
| 'external', | ||
| 'internal', | ||
| 'parent', | ||
| 'sibling', | ||
| 'index', | ||
| 'object', | ||
| 'type', | ||
| ], | ||
| 'newlines-between': 'always', | ||
| alphabetize: { order: 'asc', caseInsensitive: true }, | ||
| }, | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -18,14 +18,14 @@ | |||||
| "predev": "npm run build:ts && node scripts/clean-dev-assets.js", | ||||||
| "dev": "node scripts/index.js dev", | ||||||
| "clear-assets": "rimraf src/renderer/bundle.js src/renderer/bundle.js.map src/renderer/bundle.js.LICENSE.txt src/renderer/output.css", | ||||||
| "lint": "npm run format:check && eslint src tests --cache --max-warnings 0 && npm run lint:md && npm run test:catalog && npm run changelog:validate", | ||||||
| "lint": "npm run format:check && eslint src tests scripts eslint.config.js .eslintrc.js .babelrc.js babel.config.js jest.config.js playwright.config.ts postcss.config.js prettier.config.js tailwind.config.js webpack.config.js --cache --max-warnings 0 && npm run lint:md && npm run test:catalog && npm run changelog:validate", | ||||||
|
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. The list of config files in the
Suggested change
|
||||||
| "lint:md": "npm run lint:md:links && npm run lint:md:style", | ||||||
| "lint:md:links": "node scripts/lint-markdown-links.js", | ||||||
| "lint:md:style": "markdownlint \"**/*.{md,mdx}\" --config .markdownlint.json --ignore node_modules --ignore dist", | ||||||
| "changelog:validate": "node scripts/validate-changelog.js", | ||||||
| "lint:tests": "eslint tests --cache --max-warnings 0", | ||||||
| "format": "prettier --write \"**/*.{js,jsx,ts,tsx,json,md,html,css}\"", | ||||||
| "format:check": "prettier --check --end-of-line auto \"**/*.{json,md,html,css}\"", | ||||||
| "format:check": "prettier --check --end-of-line auto \"**/*.{json,md,html,css}\" && prettier --check --end-of-line auto \"scripts/**/*.js\" \"*.config.js\" \"eslint.config.js\" \".eslintrc.js\" \".babelrc.js\" \"jest.config.js\" \"postcss.config.js\" \"prettier.config.js\" \"tailwind.config.js\" \"webpack.config.js\" \"playwright.config.ts\"", | ||||||
|
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 script can be simplified. The two
Suggested change
|
||||||
| "test": "jest --config jest.config.js --passWithNoTests", | ||||||
| "test:watch": "jest --watch --config jest.config.js --passWithNoTests", | ||||||
| "test:stress": "jest --config jest.config.js --runInBand --testMatch=\"**/tests/stress/**/*.{js,jsx,ts,tsx}\" --verbose", | ||||||
|
|
@@ -77,7 +77,7 @@ | |||||
| "*.{json,md,html,css}": [ | ||||||
| "prettier --write" | ||||||
| ], | ||||||
| "{src,tests}/**/*.{js,jsx,ts,tsx}": [ | ||||||
| "{src,tests,scripts}/**/*.{js,jsx,ts,tsx}": [ | ||||||
| "eslint --fix" | ||||||
| ] | ||||||
| }, | ||||||
|
|
||||||
Uh oh!
There was an error while loading. Please reload this page.