Skip to content

Commit

Permalink
[code-infra] Add stylelint (#109)
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari authored May 28, 2024
1 parent 698f036 commit 238404c
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
3 changes: 3 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,9 @@ jobs:
- run:
name: Eslint
command: pnpm eslint:ci
- run:
name: Stylelint
command: pnpm stylelint
- run:
name: Lint JSON
command: pnpm jsonlint
Expand Down
5 changes: 0 additions & 5 deletions .stylelintrc.js

This file was deleted.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"jsonlint": "node ./scripts/jsonlint.mjs",
"eslint": "eslint . --cache --report-unused-disable-directives --ext .js,.ts,.tsx --max-warnings 0",
"eslint:ci": "eslint . --report-unused-disable-directives --ext .js,.ts,.tsx --max-warnings 0",
"stylelint": "stylelint --reportInvalidScopeDisables --reportNeedlessDisables \"docs/**/*.{js,ts,tsx}\"",
"stylelint": "stylelint --reportInvalidScopeDisables --reportNeedlessDisables \"{docs,examples,app}/**/*.{js,ts,tsx}\" --ignore-path .gitignore",
"markdownlint": "markdownlint-cli2 \"**/*.md\"",
"prettier": "pretty-quick --ignore-path .eslintignore",
"prettier:all": "prettier --write . --ignore-path .eslintignore",
Expand Down
12 changes: 12 additions & 0 deletions stylelint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// TODO move to ESM
const baseline = require('@mui/monorepo/.stylelintrc');

// TODO remove. In theory, deleting these lines should just work.
delete baseline.rules['declaration-colon-newline-after'];
delete baseline.rules['function-parentheses-newline-inside'];
delete baseline.rules['no-missing-end-of-source-newline'];
delete baseline.rules['value-list-comma-newline-after'];

module.exports = {
...baseline,
};

0 comments on commit 238404c

Please sign in to comment.