diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index 91fb554b..00000000 --- a/.eslintrc.js +++ /dev/null @@ -1,34 +0,0 @@ -"use strict"; - -module.exports = { - env: { - es6: true, - node: true - }, - extends: [ - "eslint:recommended", - "plugin:react/recommended", - "plugin:prettier/recommended" - ], - plugins: ["import"], - rules: { - curly: "error", - "import/no-extraneous-dependencies": [ - "error", - { devDependencies: ["tests*/**", "scripts/**"] } - ], - "no-console": "off", - "no-else-return": "error", - "no-inner-declarations": "error", - "no-unneeded-ternary": "error", - "no-useless-return": "error", - "no-var": "error", - "one-var": ["error", "never"], - "prefer-arrow-callback": "error", - "prefer-const": "error", - "react/no-deprecated": "off", - strict: "error", - "symbol-description": "error", - yoda: ["error", "never", { exceptRange: true }] - } -}; diff --git a/.eslintrc.yml b/.eslintrc.yml new file mode 100644 index 00000000..acdb4123 --- /dev/null +++ b/.eslintrc.yml @@ -0,0 +1,32 @@ +env: + es6: true + node: true +extends: +- eslint:recommended +- plugin:react/recommended +- plugin:prettier/recommended +plugins: +- import +rules: + curly: error + import/no-extraneous-dependencies: + - error + - devDependencies: ["tests*/**", "scripts/**"] + no-console: off + no-else-return: error + no-inner-declarations: error + no-unneeded-ternary: error + no-useless-return: error + no-var: error + one-var: + - error + - never + prefer-arrow-callback: error + prefer-const: error + react/no-deprecated: off + strict: error + symbol-description: error + yoda: + - error + - never + - exceptRange: true diff --git a/scripts/build/.eslintrc.js b/scripts/build/.eslintrc.js deleted file mode 100644 index 9a53ee43..00000000 --- a/scripts/build/.eslintrc.js +++ /dev/null @@ -1,12 +0,0 @@ -"use strict"; - -module.exports = { - overrides: [ - { - files: "rollup.*.config.js", - parserOptions: { - sourceType: "module" - } - } - ] -}; diff --git a/scripts/build/.eslintrc.yml b/scripts/build/.eslintrc.yml new file mode 100644 index 00000000..3a4fcae3 --- /dev/null +++ b/scripts/build/.eslintrc.yml @@ -0,0 +1,4 @@ +overrides: +- files: "rollup.*.config.js" + parserOptions: + sourceType: module diff --git a/tests/.eslintrc.js b/tests/.eslintrc.js deleted file mode 100644 index 280a88fb..00000000 --- a/tests/.eslintrc.js +++ /dev/null @@ -1,13 +0,0 @@ -"use strict"; - -module.exports = { - env: { - jest: true - }, - rules: { - strict: "off" - }, - globals: { - run_spec: false - } -}; diff --git a/tests/.eslintrc.yml b/tests/.eslintrc.yml new file mode 100644 index 00000000..ea58d110 --- /dev/null +++ b/tests/.eslintrc.yml @@ -0,0 +1,6 @@ +env: + jest: true +rules: + strict: off +globals: + run_spec: false diff --git a/tests_config/.eslintrc.js b/tests_config/.eslintrc.js deleted file mode 100644 index 5c29e440..00000000 --- a/tests_config/.eslintrc.js +++ /dev/null @@ -1,7 +0,0 @@ -"use strict"; - -module.exports = { - env: { - jest: true - } -}; diff --git a/tests_config/.eslintrc.yml b/tests_config/.eslintrc.yml new file mode 100644 index 00000000..2f8de9ae --- /dev/null +++ b/tests_config/.eslintrc.yml @@ -0,0 +1,2 @@ +env: + jest: true diff --git a/tests_integration/.eslintrc.js b/tests_integration/.eslintrc.js deleted file mode 100644 index 5c29e440..00000000 --- a/tests_integration/.eslintrc.js +++ /dev/null @@ -1,7 +0,0 @@ -"use strict"; - -module.exports = { - env: { - jest: true - } -}; diff --git a/tests_integration/.eslintrc.yml b/tests_integration/.eslintrc.yml new file mode 100644 index 00000000..2f8de9ae --- /dev/null +++ b/tests_integration/.eslintrc.yml @@ -0,0 +1,2 @@ +env: + jest: true diff --git a/website/.eslintrc.js b/website/.eslintrc.js deleted file mode 100644 index fa88a0a0..00000000 --- a/website/.eslintrc.js +++ /dev/null @@ -1,7 +0,0 @@ -"use strict"; - -module.exports = { - rules: { - "import/no-extraneous-dependencies": "off" - } -}; diff --git a/website/.eslintrc.yml b/website/.eslintrc.yml new file mode 100644 index 00000000..ef2177e1 --- /dev/null +++ b/website/.eslintrc.yml @@ -0,0 +1,2 @@ +rules: + import/no-extraneous-dependencies: off diff --git a/website/data/editors.yml b/website/data/editors.yml new file mode 100644 index 00000000..3be1f021 --- /dev/null +++ b/website/data/editors.yml @@ -0,0 +1,35 @@ +- image: "/images/atom-128px.png" + name: Atom + content: > + [`prettier-atom`](https://github.com/prettier/prettier-atom), + [`mprettier`](https://github.com/t9md/atom-mprettier) +- image: "/images/emacs-128px.png" + name: Emacs + content: > + [`prettier-emacs`](https://github.com/prettier/prettier-emacs) +- image: "/images/espresso-128px.png" + name: Espresso + content: > + [`espresso-prettier`](https://github.com/eablokker/espresso-prettier) +- image: "/images/sublimetext-128px.png" + name: Sublime Text + content: > + [`JsPrettier`](https://packagecontrol.io/packages/JsPrettier) +- image: "/images/vim-128px.png" + name: Vim + content: > + [`neoformat`](https://github.com/sbdchd/neoformat), + [`ale`](https://github.com/w0rp/ale), + [`vim-prettier`](https://github.com/prettier/vim-prettier) +- image: "/images/visualstudio-128px.png" + name: Visual Studio + content: > + [`JavaScriptPrettier`](https://github.com/madskristensen/JavaScriptPrettier) +- image: "/images/vscode-128px.png" + name: Visual Studio Code + content: > + [`prettier-vscode`](https://github.com/prettier/prettier-vscode) +- image: "/images/webstorm-128px.png" + name: WebStorm + content: > + [External Tool](https://prettier.io/docs/en/webstorm.html) diff --git a/website/data/languages.yml b/website/data/languages.yml new file mode 100644 index 00000000..db86fc91 --- /dev/null +++ b/website/data/languages.yml @@ -0,0 +1,26 @@ +- name: JavaScript + image: "/images/js-128px.png" + variants: + - "[ES2017](https://github.com/tc39/proposals/blob/master/finished-proposals.md)" + - "[JSX](https://facebook.github.io/jsx/)" + - "[Flow](https://flow.org/)" + - "[TypeScript](https://www.typescriptlang.org/)" + - "[JSON](http://json.org/)" +- name: CSS + image: "/images/css-128px.png" + variants: + - "CSS3+" + - "[Less](http://lesscss.org/)" + - "[SCSS](http://sass-lang.com)" + - "[styled-components](http://styled-components.com) 💅" + - "[styled-jsx](http://npmjs.com/styled-jsx)" +- name: GraphQL + image: "/images/graphql-128px.png" + variants: + - "[GraphQL](http://graphql.org/)" + - "[GraphQL Schemas](http://graphql.org/learn/schema/)" +- name: Markdown + image: "/images/markdown-128px.png" + variants: + - "[CommonMark](http://commonmark.org/)" + - "[GitHub Flavored Markdown](https://github.github.com/gfm/)" diff --git a/website/data/users.yml b/website/data/users.yml new file mode 100644 index 00000000..0599ca7e --- /dev/null +++ b/website/data/users.yml @@ -0,0 +1,111 @@ +- caption: React + image: "/images/react-200x100.png" + infoLink: https://facebook.github.io/react/ + pinned: true +- caption: Jest + image: "/images/jest-200x100.png" + infoLink: https://facebook.github.io/jest/ + pinned: true +- caption: Yarn + image: "/images/yarn-200x100.png" + infoLink: https://yarnpkg.com + pinned: true +- caption: Babel + image: "/images/babel-200x100.png" + infoLink: https://babeljs.io + pinned: true +- caption: ZEIT + image: "/images/zeit-200x100.png" + infoLink: https://zeit.co/ + pinned: true +- caption: Webpack CLI + image: "/images/webpack-200x100.png" + infoLink: https://webpack.js.org/api/cli/ + pinned: true +- caption: PayPal + image: "/images/paypal-200x100.png" + infoLink: https://github.com/paypal +- caption: Hudl + image: "/images/hudl-200x100.png" + infoLink: http://hudl.github.io/ +- caption: Transloadit + image: "/images/transloadit-200x100.png" + infoLink: https://transloadit.com/ +- caption: Tradeshift + image: "/images/tradeshift-200x100.png" + infoLink: https://tradeshift.com/ +- caption: Algolia + image: "/images/algolia-200x100.png" + infoLink: https://algolia.com +- caption: IRESS + image: "/images/iress-200x100.png" + infoLink: https://iress.com +- caption: Outreach + image: "/images/outreach-200x100.png" + infoLink: https://www.outreach.io/ +- caption: Material-UI + image: "/images/materialui-200x100.png" + infoLink: http://www.material-ui.com/ +- caption: Wire + image: "/images/wire-200x100.png" + infoLink: https://wire.com +- caption: MoonMail + image: "/images/moonmail-200x100.png" + infoLink: https://moonmail.io +- caption: MONEI + image: "/images/monei-200x100.png" + infoLink: https://monei.net +- caption: Talkable + image: "/images/talkable-200x100.png" + infoLink: https://talkable.com +- caption: Smooth Code + image: "/images/smooth-code-200x100.png" + infoLink: https://www.smooth-code.com +- caption: Webflow + image: "/images/webflow-200x100.png" + infoLink: https://webflow.com +- caption: Eye Square + image: "/images/eyesquare-200x100.png" + infoLink: http://www.eye-square.com +- caption: Charlie Tango + image: "/images/charlietango-200x100.png" + infoLink: https://charlietango.dk +- caption: EventsTag + image: "/images/eventstag-200x100.png" + infoLink: https://eventstag.com +- caption: ZIP.ch + image: "/images/zipch-200x100.png" + infoLink: https://zip.ch +- caption: Nrwl + image: "/images/nrwl-200x100.png" + infoLink: https://nrwl.io +- caption: codemix + image: "/images/codemix-200x100.png" + infoLink: https://codemix.com +- caption: HolidayCheck + image: "/images/holidaycheck-200x100.png" + infoLink: https://www.holidaycheck.de +- caption: 7Span + image: "/images/sevenspan-200x100.png" + infoLink: https://7span.com +- caption: IDEATI + image: "/images/ideati-200x100.png" + infoLink: http://www.ideati.net +- caption: Mathrioshka + image: "/images/mathrioshka-200x100.png" + infoLink: https://mathrioshka.ru +- caption: Wingify + image: "/images/wingify-200x100.png" + infoLink: https://wingify.com +- caption: N26 + image: "/images/n26-200x100.png" + infoLink: https://n26.com +- caption: Yelp + image: "/images/yelp-200x100.png" + infoLink: https://www.yelp.com +- caption: Hasura + image: "/images/hasura-200x100.png" + infoLink: https://hasura.io +- caption: Troops + image: "/images/troops-200x100.png" + infoLink: https://troops.ai diff --git a/website/editors.json b/website/editors.json deleted file mode 100644 index f4428415..00000000 --- a/website/editors.json +++ /dev/null @@ -1,42 +0,0 @@ -[ - { - "image": "/images/atom-128px.png", - "name": "Atom", - "content": "[`prettier-atom`](https://github.com/prettier/prettier-atom), [`mprettier`](https://github.com/t9md/atom-mprettier)" - }, - { - "image": "/images/emacs-128px.png", - "name": "Emacs", - "content": "[`prettier-emacs`](https://github.com/prettier/prettier-emacs)" - }, - { - "image": "/images/espresso-128px.png", - "name": "Espresso", - "content": "[`espresso-prettier`](https://github.com/eablokker/espresso-prettier)" - }, - { - "image": "/images/sublimetext-128px.png", - "name": "Sublime Text", - "content": "[`JsPrettier`](https://packagecontrol.io/packages/JsPrettier)" - }, - { - "image": "/images/vim-128px.png", - "name": "Vim", - "content": "[`neoformat`](https://github.com/sbdchd/neoformat), [`ale`](https://github.com/w0rp/ale), [`vim-prettier`](https://github.com/prettier/vim-prettier)" - }, - { - "image": "/images/visualstudio-128px.png", - "name": "Visual Studio", - "content": "[`JavaScriptPrettier`](https://github.com/madskristensen/JavaScriptPrettier)" - }, - { - "image": "/images/vscode-128px.png", - "name": "Visual Studio Code", - "content": "[`prettier-vscode`](https://github.com/prettier/prettier-vscode)" - }, - { - "image": "/images/webstorm-128px.png", - "name": "WebStorm", - "content": "[External Tool](https://prettier.io/docs/en/webstorm.html)" - } -] diff --git a/website/languages.json b/website/languages.json deleted file mode 100644 index b22c77a8..00000000 --- a/website/languages.json +++ /dev/null @@ -1,40 +0,0 @@ -[ - { - "name": "JavaScript", - "image": "/images/js-128px.png", - "variants": [ - "[ES2017](https://github.com/tc39/proposals/blob/master/finished-proposals.md)", - "[JSX](https://facebook.github.io/jsx/)", - "[Flow](https://flow.org/)", - "[TypeScript](https://www.typescriptlang.org/)", - "[JSON](http://json.org/)" - ] - }, - { - "name": "CSS", - "image": "/images/css-128px.png", - "variants": [ - "CSS3+", - "[Less](http://lesscss.org/)", - "[SCSS](http://sass-lang.com)", - "[styled-components](http://styled-components.com) 💅", - "[styled-jsx](http://npmjs.com/styled-jsx)" - ] - }, - { - "name": "GraphQL", - "image": "/images/graphql-128px.png", - "variants": [ - "[GraphQL](http://graphql.org/)", - "[GraphQL Schemas](http://graphql.org/learn/schema/)" - ] - }, - { - "name": "Markdown", - "image": "/images/markdown-128px.png", - "variants": [ - "[CommonMark](http://commonmark.org/)", - "[GitHub Flavored Markdown](https://github.github.com/gfm/)" - ] - } -] diff --git a/website/package.json b/website/package.json index d190fa31..67ba2c30 100644 --- a/website/package.json +++ b/website/package.json @@ -5,6 +5,7 @@ "publish-gh-pages": "docusaurus-publish" }, "devDependencies": { - "docusaurus": "^1.0.0-beta.10" + "docusaurus": "^1.0.0-beta.10", + "js-yaml": "^3.10.0" } } diff --git a/website/pages/en/index.js b/website/pages/en/index.js index 73a98c13..e29ee583 100755 --- a/website/pages/en/index.js +++ b/website/pages/en/index.js @@ -140,7 +140,9 @@ class Index extends React.Component {

Developed an integration?

Add it here diff --git a/website/pages/en/users/index.js b/website/pages/en/users/index.js index 14ce14bd..b0212401 100644 --- a/website/pages/en/users/index.js +++ b/website/pages/en/users/index.js @@ -37,7 +37,9 @@ class Users extends React.Component {

Are you using this project?

Add your company diff --git a/website/siteConfig.js b/website/siteConfig.js index be50e8de..88afa113 100644 --- a/website/siteConfig.js +++ b/website/siteConfig.js @@ -2,12 +2,20 @@ // Docs: https://docusaurus.io/docs/en/site-config.html +const parseYaml = require("js-yaml").safeLoad; +const path = require("path"); +const fs = require("fs"); + const PACKAGE = require("../package"); const GITHUB_URL = `https://github.com/${PACKAGE.repository}`; -const users = require("./users"); -const editors = require("./editors"); -const supportedLanguages = require("./languages"); +function loadYaml(fsPath) { + return parseYaml(fs.readFileSync(path.join(__dirname, fsPath), "utf8")); +} + +const users = loadYaml("./data/users.yml"); +const editors = loadYaml("./data/editors.yml"); +const supportedLanguages = loadYaml("./data/languages.yml"); const siteConfig = { title: "Prettier", diff --git a/website/users.json b/website/users.json deleted file mode 100644 index da15b4bf..00000000 --- a/website/users.json +++ /dev/null @@ -1,183 +0,0 @@ -[ - { - "caption": "React", - "image": "/images/react-200x100.png", - "infoLink": "https://facebook.github.io/react/", - "pinned": true - }, - { - "caption": "Jest", - "image": "/images/jest-200x100.png", - "infoLink": "https://facebook.github.io/jest/", - "pinned": true - }, - { - "caption": "Yarn", - "image": "/images/yarn-200x100.png", - "infoLink": "https://yarnpkg.com", - "pinned": true - }, - { - "caption": "Babel", - "image": "/images/babel-200x100.png", - "infoLink": "https://babeljs.io", - "pinned": true - }, - { - "caption": "ZEIT", - "image": "/images/zeit-200x100.png", - "infoLink": "https://zeit.co/", - "pinned": true - }, - { - "caption": "Webpack CLI", - "image": "/images/webpack-200x100.png", - "infoLink": "https://webpack.js.org/api/cli/", - "pinned": true - }, - { - "caption": "PayPal", - "image": "/images/paypal-200x100.png", - "infoLink": "https://github.com/paypal" - }, - { - "caption": "Hudl", - "image": "/images/hudl-200x100.png", - "infoLink": "http://hudl.github.io/" - }, - { - "caption": "Transloadit", - "image": "/images/transloadit-200x100.png", - "infoLink": "https://transloadit.com/" - }, - { - "caption": "Tradeshift", - "image": "/images/tradeshift-200x100.png", - "infoLink": "https://tradeshift.com/" - }, - { - "caption": "Algolia", - "image": "/images/algolia-200x100.png", - "infoLink": "https://algolia.com" - }, - { - "caption": "IRESS", - "image": "/images/iress-200x100.png", - "infoLink": "https://iress.com" - }, - { - "caption": "Outreach", - "image": "/images/outreach-200x100.png", - "infoLink": "https://www.outreach.io/" - }, - { - "caption": "Material-UI", - "image": "/images/materialui-200x100.png", - "infoLink": "http://www.material-ui.com/" - }, - { - "caption": "Wire", - "image": "/images/wire-200x100.png", - "infoLink": "https://wire.com" - }, - { - "caption": "MoonMail", - "image": "/images/moonmail-200x100.png", - "infoLink": "https://moonmail.io" - }, - { - "caption": "MONEI", - "image": "/images/monei-200x100.png", - "infoLink": "https://monei.net" - }, - { - "caption": "Talkable", - "image": "/images/talkable-200x100.png", - "infoLink": "https://talkable.com" - }, - { - "caption": "Smooth Code", - "image": "/images/smooth-code-200x100.png", - "infoLink": "https://www.smooth-code.com" - }, - { - "caption": "Webflow", - "image": "/images/webflow-200x100.png", - "infoLink": "https://webflow.com" - }, - { - "caption": "Eye Square", - "image": "/images/eyesquare-200x100.png", - "infoLink": "http://www.eye-square.com" - }, - { - "caption": "Charlie Tango", - "image": "/images/charlietango-200x100.png", - "infoLink": "https://charlietango.dk" - }, - { - "caption": "EventsTag", - "image": "/images/eventstag-200x100.png", - "infoLink": "https://eventstag.com" - }, - { - "caption": "ZIP.ch", - "image": "/images/zipch-200x100.png", - "infoLink": "https://zip.ch" - }, - { - "caption": "Nrwl", - "image": "/images/nrwl-200x100.png", - "infoLink": "https://nrwl.io" - }, - { - "caption": "codemix", - "image": "/images/codemix-200x100.png", - "infoLink": "https://codemix.com" - }, - { - "caption": "HolidayCheck", - "image": "/images/holidaycheck-200x100.png", - "infoLink": "https://www.holidaycheck.de" - }, - { - "caption": "7Span", - "image": "/images/sevenspan-200x100.png", - "infoLink": "https://7span.com" - }, - { - "caption": "IDEATI", - "image": "/images/ideati-200x100.png", - "infoLink": "http://www.ideati.net" - }, - { - "caption": "Mathrioshka", - "image": "/images/mathrioshka-200x100.png", - "infoLink": "https://mathrioshka.ru" - }, - { - "caption": "Wingify", - "image": "/images/wingify-200x100.png", - "infoLink": "https://wingify.com" - }, - { - "caption": "N26", - "image": "/images/n26-200x100.png", - "infoLink": "https://n26.com" - }, - { - "caption": "Yelp", - "image": "/images/yelp-200x100.png", - "infoLink": "https://www.yelp.com" - }, - { - "caption": "Hasura", - "image": "/images/hasura-200x100.png", - "infoLink": "https://hasura.io" - }, - { - "caption": "Troops", - "image": "/images/troops-200x100.png", - "infoLink": "https://troops.ai" - } -] diff --git a/website/yarn.lock b/website/yarn.lock index b349f614..afd4d93e 100644 --- a/website/yarn.lock +++ b/website/yarn.lock @@ -944,6 +944,10 @@ escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" +esprima@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.0.tgz#4499eddcd1110e0b218bacf2fa7f7f59f55ca804" + esutils@^2.0.0, esutils@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" @@ -1254,6 +1258,13 @@ js-tokens@^3.0.0, js-tokens@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" +js-yaml@^3.10.0: + version "3.10.0" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.10.0.tgz#2e78441646bd4682e963f22b6e92823c309c62dc" + dependencies: + argparse "^1.0.7" + esprima "^4.0.0" + jsbn@~0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513"