Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions docs/babel.config.ts.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const path = require('path');
const prettier = require('prettier');
const ignoredDemos = require('./ts-demo-ignore.json');

/**
Expand All @@ -13,18 +12,12 @@ const ignoredDemos = require('./ts-demo-ignore.json');
*/

const workspaceRoot = path.join(__dirname, '../');
const prettierConfig = prettier.resolveConfig.sync(workspaceRoot);
if (prettierConfig == null) {
throw new Error('Could not find prettier config file from workspace root.');
}

const ignore = ignoredDemos.map(demoPath =>
path.join(workspaceRoot, 'docs/src/pages/demos', `${demoPath}.tsx`),
);

module.exports = {
presets: ['@babel/preset-typescript'],
plugins: ['generator-prettier', 'unwrap-createStyles'],
generatorOpts: prettierConfig,
plugins: ['unwrap-createStyles'],
ignore,
};
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"docs:size-why": "DOCS_STATS_ENABLED=true yarn docs:build",
"docs:build-sw": "babel-node ./docs/scripts/buildServiceWorker.js",
"docs:deploy": "git push material-ui-docs master:latest",
"docs:typescript": "cross-env NODE_ENV=development babel docs/src --config-file ./docs/babel.config.ts.js --extensions .tsx --out-dir docs/src",
"docs:typescript": "cross-env NODE_ENV=development babel docs/src --config-file ./docs/babel.config.ts.js --extensions .tsx --out-dir docs/src && yarn prettier",
"jsonlint": "yarn --silent jsonlint:files | xargs -n1 jsonlint -q -c && echo \"jsonlint: no lint errors\"",
"jsonlint:files": "find . -name \"*.json\" | grep -v -f .eslintignore",
"lint": "eslint . --cache && echo \"eslint: no lint errors\"",
Expand Down Expand Up @@ -80,7 +80,6 @@
"babel-eslint": "^10.0.0",
"babel-core": "^7.0.0-bridge.0",
"babel-loader": "^8.0.0",
"babel-plugin-generator-prettier": "^1.1.0",
"babel-plugin-istanbul": "^5.0.0",
"babel-plugin-module-resolver": "^3.0.0",
"babel-plugin-preval": "^2.0.0",
Expand Down
11 changes: 1 addition & 10 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2705,15 +2705,6 @@ babel-plugin-emotion@^9.2.11:
source-map "^0.5.7"
touch "^2.0.1"

babel-plugin-generator-prettier@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/babel-plugin-generator-prettier/-/babel-plugin-generator-prettier-1.1.0.tgz#05ca3e28932ad5d16e523bc5c72930a8840a03e2"
integrity sha512-G+v0Lbw2pPIPeYlDeg1lttOsKoPW/0/9RO+hiAtmvWqRnrB2Hp1rMvjz3ROps94NBU/+uHHF0YIPr9s+FpihbQ==
dependencies:
has "^1.0.3"
prettier "^1.13.6"
source-map "^0.5.7"

babel-plugin-istanbul@^5.0.0:
version "5.1.0"
resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-5.1.0.tgz#6892f529eff65a3e2d33d87dc5888ffa2ecd4a30"
Expand Down Expand Up @@ -10240,7 +10231,7 @@ preserve@^0.2.0:
resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b"
integrity sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=

prettier@^1.13.6, prettier@^1.8.2:
prettier@^1.8.2:
version "1.15.2"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.15.2.tgz#d31abe22afa4351efa14c7f8b94b58bb7452205e"
integrity sha512-YgPLFFA0CdKL4Eg2IHtUSjzj/BWgszDHiNQAe0VAIBse34148whfdzLagRL+QiKS+YfK5ftB6X4v/MBw8yCoug==
Expand Down