Skip to content
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

Run prettier on all files in repo #2033

Merged
merged 1 commit into from Jul 11, 2019
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 2 additions & 6 deletions .babelrc.js
Expand Up @@ -9,14 +9,10 @@ module.exports = {
],
env: {
cjs: {
presets: [
['@babel/preset-env', { modules: 'commonjs' }],
],
presets: [['@babel/preset-env', { modules: 'commonjs' }]],
},
mjs: {
presets: [
['@babel/preset-env', { modules: false }],
],
presets: [['@babel/preset-env', { modules: false }]],
},
},
};
22 changes: 10 additions & 12 deletions .eslintrc.yml
Expand Up @@ -6,12 +6,8 @@ env:
node: true
plugins:
- flowtype
- prettier

rules:
# https://github.com/prettier/eslint-plugin-prettier#installation
prettier/prettier: error

# `eslint-plugin-flowtype` rule list based on `v3.11.x`
# https://github.com/gajus/eslint-plugin-flowtype#eslint-plugin-flowtype

Expand All @@ -35,7 +31,8 @@ rules:
flowtype/require-readonly-react-props: off
flowtype/require-return-type: off
flowtype/require-types-at-top: off
flowtype/require-valid-file-annotation: [error, always, { annotationStyle: line, strict: true }]
flowtype/require-valid-file-annotation:
[error, always, { annotationStyle: line, strict: true }]
flowtype/require-variable-type: off
flowtype/sort-keys: off
flowtype/spread-exact-type: off
Expand Down Expand Up @@ -130,7 +127,7 @@ rules:
no-implied-eval: error
no-invalid-this: off
no-iterator: error
no-labels: [error, {allowLoop: true}]
no-labels: [error, { allowLoop: true }]
no-lone-blocks: error
no-loop-func: error
no-magic-numbers: off
Expand Down Expand Up @@ -168,7 +165,7 @@ rules:
require-await: off # TODO
require-unicode-regexp: off
vars-on-top: error
yoda: [error, never, {exceptRange: true}]
yoda: [error, never, { exceptRange: true }]

# Strict Mode
# https://eslint.org/docs/rules/#strict-mode
Expand All @@ -187,7 +184,8 @@ rules:
no-undef: error
no-undef-init: error
no-undefined: off
no-unused-vars: [error, {vars: all, args: after-used, argsIgnorePattern: "^_"}]
no-unused-vars:
[error, { vars: all, args: after-used, argsIgnorePattern: '^_' }]
no-use-before-define: off

# Node.js and CommonJS
Expand All @@ -208,15 +206,15 @@ rules:
# Stylistic Issues
# https://eslint.org/docs/rules/#stylistic-issues

camelcase: [error, {properties: always}]
camelcase: [error, { properties: always }]
capitalized-comments: off # maybe
consistent-this: off
func-name-matching: off
func-names: off
func-style: off
id-blacklist: off
id-length: off
id-match: [error, "^(?:_?[a-zA-Z0-9]*)|[_A-Z0-9]+$"]
id-match: [error, '^(?:_?[a-zA-Z0-9]*)|[_A-Z0-9]+$']
line-comment-position: off
lines-around-comment: off
lines-between-class-members: [error, always, { exceptAfterSingleLine: true }]
Expand Down Expand Up @@ -353,10 +351,10 @@ rules:
yield-star-spacing: off

overrides:
- files: "**/__tests__/**"
- files: '**/__tests__/**'
rules:
no-restricted-syntax: off
- files: "resources/**"
- files: 'resources/**'
parserOptions:
sourceType: script
rules:
Expand Down
23 changes: 11 additions & 12 deletions .github/CONTRIBUTING.md
@@ -1,5 +1,4 @@
Contributing to graphql-js
==========================
# Contributing to graphql-js

We want to make contributing to this project as easy and transparent as
possible. Hopefully this document makes the process for contributing clear and
Expand Down Expand Up @@ -72,23 +71,23 @@ This will watch the file system run any relevant lint, tests, and type checks au
This project uses [Prettier](https://prettier.io/) for standard formatting. To
ensure your pull request matches the style guides, run `npm run prettier`.

* 2 spaces for indentation (no tabs)
* 80 character line length strongly preferred.
* Prefer `'` over `"`
* ES6 syntax when possible. However do not rely on ES6-specific functions to be available.
* Use [Flow types](https://flowtype.org/).
* Use semicolons;
* Trailing commas,
* Avd abbr wrds.
- 2 spaces for indentation (no tabs)
- 80 character line length strongly preferred.
- Prefer `'` over `"`
- ES6 syntax when possible. However do not rely on ES6-specific functions to be available.
- Use [Flow types](https://flowtype.org/).
- Use semicolons;
- Trailing commas,
- Avd abbr wrds.

## Release on NPM

*Only core contributors may release to NPM.*
_Only core contributors may release to NPM._

To release a new version on NPM, first ensure all tests pass with `npm test`,
then use `npm version patch|minor|major` in order to increment the version in
package.json and tag and commit a release. Then `git push && git push --tags`
this change so Travis CI can deploy to NPM. *Do not run `npm publish` directly.*
this change so Travis CI can deploy to NPM. _Do not run `npm publish` directly._
Once published, add [release notes](https://github.com/graphql/graphql-js/tags).
Use [semver](https://semver.org/) to determine which version part to increment.

Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE.md
Expand Up @@ -10,7 +10,7 @@ Please do not post general questions directly as GitHub issues. They may sit for

Before filing a new issue, make sure an issue for your problem doesn't already exist.

The best way to get a bug fixed is to provide a *pull request* with a simplified failing test case (or better yet, include a fix).
The best way to get a bug fixed is to provide a _pull request_ with a simplified failing test case (or better yet, include a fix).

# Feature requests

Expand Down
8 changes: 4 additions & 4 deletions .nycflowrc.yml
@@ -1,10 +1,10 @@
include:
- "src/"
- 'src/'
exclude:
- "src/polyfills"
- 'src/polyfills'
clean: true
temp-directory: "coverage/flow"
report-dir: "coverage/flow"
temp-directory: 'coverage/flow'
report-dir: 'coverage/flow'
skip-full: true
skip-empty: true
reporter: [json, html, text]
8 changes: 4 additions & 4 deletions .nycrc.yml
@@ -1,9 +1,9 @@
include:
- "src/"
- 'src/'
exclude:
- "src/polyfills"
- 'src/polyfills'
clean: true
temp-directory: "coverage/tests"
report-dir: "coverage/tests"
temp-directory: 'coverage/tests'
report-dir: 'coverage/tests'
skip-full: true
reporter: [json, html, text]
20 changes: 10 additions & 10 deletions .travis.yml
Expand Up @@ -5,10 +5,10 @@ cache: yarn

# https://github.com/nodejs/Release
node_js:
- '12'
- '10'
- '8'
- '6'
- '12'
- '10'
- '8'
- '6'

script: |
if [[ "$(node -pe process.version)" == v10.* ]]; then # Is latest LTS?
Expand All @@ -20,11 +20,11 @@ script: |
jobs:
include:
- stage: deploy
if: type = push AND branch = master
script: npm run gitpublish
skip_cleanup: true
node_js: '10'
- stage: deploy
if: type = push AND branch = master
script: npm run gitpublish
skip_cleanup: true
node_js: '10'

notifications:
irc:
Expand All @@ -33,7 +33,7 @@ notifications:
on_failure: change
skip_join: true
channels:
- chat.freenode.net#graphql
- chat.freenode.net#graphql
slack:
secure: G7fzaXoPI1cyyW7dlpQ8oG/ot73n4kE83HgbyK1iEN1YBfodsytVgh0jS+zB3DhhRAotS/VfGVz9Wj2Oo109U5w/FyxdMGuKvFan/0B/aAws1sPxLGWA5230u1wTKQCHAu17+yppFOODUu1ILDXaD2A//Wj5iru9M4NnKc1bO6VHkfBHPTLQLbdPHmorwuSH02Ocbh7K4XOWzXRxM6VrwamEn1KnyXGu2w3QdJUT31OjGEEdf6FUzvjwzFgXPhngCw5+enpwm71ljHDNu8YHhXvHtS4328O5pYQO8np7j653HNEqi+ZUiYEOWpwC8be1xHdvi/s32tPFZiCx28ZmDoCUrY744tpPtE6tzuncmSKB0Y3EjutdXBpxllNr5l5hpX5092G2MlpokFbv85J+E2ALcZYNYeFOqTYTKwTYkxK6B1x4amBNpM+FXgUhloK4BK9OT0Qh5SiQOsM8cZT0h6QP91n+REljtpugW3VbuIxq5OJAi42FYbHBC27pohhq6ohU1euZfobk9a7ZawnjoEUk1EZHXiJzYKY/QqzyB6dwk0ersBl3l3OX/wnjwKTkqc9aTmDWo2L+lHaUCXuCY1+KQXsRicfnH395szTJXQbvcbN0zz188gdz6sawzi5BxndWo0NRwZyOG2YcyUHFQR4bK1rL7Lo6t6rijQ/XMeQ=

Expand Down
15 changes: 5 additions & 10 deletions README.md
Expand Up @@ -11,7 +11,6 @@ https://graphql.org/graphql-js/.

Looking for help? Find resources [from the community](https://graphql.org/community/).


## Getting Started

An overview of GraphQL in general is available in the
Expand Down Expand Up @@ -47,7 +46,7 @@ import {
graphql,
GraphQLSchema,
GraphQLObjectType,
GraphQLString
GraphQLString,
} from 'graphql';

var schema = new GraphQLSchema({
Expand All @@ -58,10 +57,10 @@ var schema = new GraphQLSchema({
type: GraphQLString,
resolve() {
return 'world';
}
}
}
})
},
},
},
}),
});
```

Expand All @@ -76,13 +75,11 @@ Then, serve the result of a query against that type schema.
var query = '{ hello }';

graphql(schema, query).then(result => {

// Prints
// {
// data: { hello: "world" }
// }
console.log(result);

});
```

Expand All @@ -94,7 +91,6 @@ it, reporting errors otherwise.
var query = '{ boyhowdy }';

graphql(schema, query).then(result => {

// Prints
// {
// errors: [
Expand All @@ -103,7 +99,6 @@ graphql(schema, query).then(result => {
// ]
// }
console.log(result);

});
```

Expand Down
10 changes: 5 additions & 5 deletions docs/APIReference-GraphQL.md
Expand Up @@ -17,7 +17,7 @@ var { graphql } = require('graphql'); // CommonJS

## Overview

*Entry Point*
_Entry Point_

<ul class="apiIndex">
<li>
Expand All @@ -28,7 +28,7 @@ var { graphql } = require('graphql'); // CommonJS
</li>
</ul>

*Schema*
_Schema_

<ul class="apiIndex">
<li>
Expand All @@ -39,7 +39,7 @@ var { graphql } = require('graphql'); // CommonJS
</li>
</ul>

*Type Definitions*
_Type Definitions_

<ul class="apiIndex">
<li>
Expand Down Expand Up @@ -92,7 +92,7 @@ var { graphql } = require('graphql'); // CommonJS
</li>
</ul>

*Scalars*
_Scalars_

<ul class="apiIndex">
<li>
Expand Down Expand Up @@ -127,7 +127,7 @@ var { graphql } = require('graphql'); // CommonJS
</li>
</ul>

*Errors*
_Errors_

<ul class="apiIndex">
<li>
Expand Down