-
Notifications
You must be signed in to change notification settings - Fork 22
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
#6778: Fail CI on dependency cycles and remove madge #6857
Changes from all commits
e7b7d28
e04593c
5bc95ff
ed072bd
e9e4418
28054d9
ea9aa48
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 | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -91,9 +91,6 @@ module.exports = { | ||||||||||
|
|||||||||||
// Rules that depend on https://github.com/pixiebrix/pixiebrix-extension/issues/775 | |||||||||||
"@typescript-eslint/restrict-template-expressions": "warn", | |||||||||||
|
|||||||||||
// Enabled for the IDE, but it's disabled in the `lint` script | |||||||||||
"import/no-cycle": "warn", | |||||||||||
}, | |||||||||||
overrides: [ | |||||||||||
{ | |||||||||||
|
@@ -129,3 +126,12 @@ module.exports = { | ||||||||||
}, | |||||||||||
], | |||||||||||
}; | |||||||||||
|
|||||||||||
// `npm run lint:fast` will skip the (slow) import/* rules | |||||||||||
// Useful if you're trying to iterate fixes over other rules | |||||||||||
if (process.env.ESLINT_NO_IMPORTS) { | |||||||||||
const importRules = Object.keys(require("eslint-plugin-import").rules); | |||||||||||
for (const ruleName of importRules) { | |||||||||||
module.exports.rules[`import/${ruleName}`] = "off"; | |||||||||||
} | |||||||||||
} | |||||||||||
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. Restore from pixiebrix/eslint-config-pixiebrix#122
Side note, still applies: |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -152,21 +152,7 @@ jobs: | |
node-version-file: package.json | ||
cache: npm | ||
- run: npm ci | ||
- run: npm run lint -- --quiet | ||
|
||
circular-deps: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version-file: package.json | ||
cache: npm | ||
# Fixed version to avoid random breaks. Not in package.json due to #1084 | ||
- run: npm install --global madge@5.0.1 | ||
- run: npm run madge:circular | ||
name: Detect circular dependencies | ||
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. I dropped Madge because it's now redundant |
||
- run: npm run lint:full | ||
|
||
# https://pre-commit.com/#usage-in-continuous-integration | ||
prettier: | ||
|
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 |
---|---|---|
|
@@ -5,7 +5,9 @@ | |
"scripts": { | ||
"test": "TZ=UTC jest", | ||
"test:watch": "TZ=UTC jest --watchAll", | ||
"lint": "eslint src --ext js,jsx,ts,tsx --quiet --report-unused-disable-directives --rule '{\"import/no-cycle\": \"off\"}'", | ||
"lint": "npm run lint:full -- --rule '{\"import/no-cycle\": \"off\"}'", | ||
"lint:fast": "ESLINT_NO_IMPORTS=1 eslint src --ext js,jsx,ts,tsx --quiet", | ||
"lint:full": "eslint src --ext js,jsx,ts,tsx --quiet --report-unused-disable-directives", | ||
"fix": "npm run lint -- --fix", | ||
"watch": "concurrently npm:watch:webpack 'npm:watch:*(!webpack) -- --preserveWatchOutput' -r", | ||
"watch:webpack": "ENV_FILE='.env.development' webpack --mode development --watch", | ||
|
@@ -18,8 +20,7 @@ | |
"build:scripts": "webpack --config scripts/webpack.scripts.js", | ||
"generate:headers": "NODE_OPTIONS=--stack-trace-limit=100 node scripts/bin/headers.js", | ||
"storybook": "storybook dev -p 6006 -s public", | ||
"build-storybook": "storybook build", | ||
"madge:circular": "madge --extensions js,ts,tsx --circular src/** --ts-config tsconfig.json" | ||
"build-storybook": "storybook build" | ||
}, | ||
"engine-strict": true, | ||
"engines": { | ||
|
@@ -214,6 +215,7 @@ | |
"@types/json-stringify-safe": "^5.0.2", | ||
"@types/lodash": "^4.14.201", | ||
"@types/mark.js": "^8.11.10", | ||
"@types/marked": "^6.0.0", | ||
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 also fixes one of the issues reported by: |
||
"@types/mustache": "^4.2.5", | ||
"@types/nunjucks": "^3.2.5", | ||
"@types/object-hash": "^2.1.1", | ||
|
@@ -248,7 +250,7 @@ | |
"css-minimizer-webpack-plugin": "^3.4.1", | ||
"dotenv": "^16.3.1", | ||
"eslint": "^8.53.0", | ||
"eslint-config-pixiebrix": "^0.31.0", | ||
"eslint-config-pixiebrix": "^0.32.0", | ||
"eslint-plugin-local-rules": "^2.0.0", | ||
"fake-indexeddb": "^5.0.1", | ||
"identity-obj-proxy": "^3.0.0", | ||
|
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.
eslint-disable-next-line
"import/no-cycle": "warn",
can be added there