Skip to content

Commit

Permalink
Docs: Remove/change "just [insert any task here]"
Browse files Browse the repository at this point in the history
  • Loading branch information
alrra committed Apr 8, 2018
1 parent 654c30d commit e543db4
Show file tree
Hide file tree
Showing 40 changed files with 115 additions and 106 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -17,7 +17,7 @@ to use it.

### Using `npx`

Just run the following command:
Run the following command:

```bash
npx sonarwhal https://example.com
Expand Down
4 changes: 2 additions & 2 deletions packages/formatter-json/src/formatter.ts
@@ -1,6 +1,6 @@
/**
* @fileoverview The most basic formatter, it just stringifyes whatever object
* is passed to it.
* @fileoverview The most basic formatter, it stringifyes whatever
* object is passed to it.
*/

/*
Expand Down
4 changes: 2 additions & 2 deletions packages/parser-babel-config/README.md
Expand Up @@ -61,8 +61,8 @@ This `parser` emits the following events:

## Types

If you need to import any type or enum defined in this parser, you just need to
import them as follows:
If you need to import any type or enum defined in this parser,
you need to import them as follows:

```ts
import { TypeOrEnumYouWantToUse } from '@sonarwhal/parser-babel-config/dist/src/types';
Expand Down
4 changes: 2 additions & 2 deletions packages/parser-typescript-config/README.md
Expand Up @@ -62,8 +62,8 @@ This `parser` emits the following events:

## Types

If you need to import any type or enum defined in this parser, you just need to
import them as follows:
If you need to import any type or enum defined in this parser, you
need to import them as follows:

```ts
import { TypeOrEnumYouWantToUse } from '@sonarwhal/parser-typescript-config/dist/src/types';
Expand Down
12 changes: 6 additions & 6 deletions packages/rule-apple-touch-icons/README.md
Expand Up @@ -26,7 +26,7 @@ bit:
* `152×152px` – iPad and iPad mini with @2x display running iOS 7
* `180×180px` – iPad and iPad mini with @2x display running iOS 8+

However, declaring just one `180×180px` PNG image, e.g.:
However, declaring one `180×180px` PNG image, e.g.:

```html
<link rel="apple-touch-icon" href="apple-touch-icon.png">
Expand All @@ -35,7 +35,7 @@ However, declaring just one `180×180px` PNG image, e.g.:
in the `<head>` of the page is enough, and including all the different
sizes is not recommended as:

* It will just increase the size of the pages with very little to no
* It will increase the size of the pages with very little to no
real benefit (most users will probably not add the site to their
homescreens).

Expand All @@ -54,8 +54,8 @@ as users upgrade their devices and their iOS version.

Other notes:

* Not declaring the touch icon in the page, and just having it in
the root of the site is not recommended as [Apple usually changes
* Not declaring the touch icon in the page, and having it in the
root of the site is not recommended as [Apple usually changes
what is requested by default][h5bp issue 1622].

* In older versions of Safari for iOS the [`precomposed` keyword][icon
Expand All @@ -67,7 +67,7 @@ Other notes:

* Safari for iOS < 4.2 [ignored the `sizes` attribute, so the order
in which the icons were declared mattered][icon sizes]. When using
just one image there is no need to use the `sizes` attribute.
one image there is no need to use the `sizes` attribute.

## How to use this rule?

Expand Down Expand Up @@ -234,7 +234,7 @@ apple-touch-icon.png: PNG image data, 180 x 180, ...

* [Everything you always wanted to know about touch
icons][touch icons]
* [Is there a need for multiple touch icons when just one will work?][h5bp
* [Is there a need for multiple touch icons when one will work?][h5bp
issue 1367]

<!-- Link labels: -->
Expand Down
6 changes: 3 additions & 3 deletions packages/rule-apple-touch-icons/src/rule.ts
Expand Up @@ -251,9 +251,9 @@ export default class AppleTouchIconsRule implements IRule {

/*
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
* Since we are recommending just one icon, the `sizes`
* attribute is not needed. Also, pre-4.2 versions of iOS
* ignore the `sizes` attribute.
* Since we are recommending one icon, the `sizes` attribute
* is not needed. Also, pre-4.2 versions of iOS ignore the
* `sizes` attribute.
*
* https://mathiasbynens.be/notes/touch-icons
* https://html.spec.whatwg.org/multipage/semantics.html#attr-link-sizes
Expand Down
2 changes: 1 addition & 1 deletion packages/rule-content-type/README.md
Expand Up @@ -290,7 +290,7 @@ Note that:
[using `.htaccess` files slows down][htaccess is slow] Apache!

If you don't have access to the main configuration file (quite
common with hosting services), just add the snippets in a `.htaccess`
common with hosting services), add the snippets in a `.htaccess`
file in the root of the web site/app.

</details>
Expand Down
14 changes: 7 additions & 7 deletions packages/rule-highest-available-document-mode/README.md
Expand Up @@ -278,12 +278,12 @@ header using the [`Header` directive][header directive].
## Removing the `X-UA-Compatible` header on Apache

If the header is sent, in most cases, to make Apache stop sending
the `X-UA-Compatible` requires just removing the configuration that
adds it (i.e.: something such as `Header set X-UA-Compatible
"IE=edge"`). However, if the header is added from somewhere in the
stack (e.g. the framework level, language level such as PHP, etc.),
and that cannot be changed, you can try to remove it at the `Apache`
level, using the following:
the `X-UA-Compatible` requires removing the configuration that adds
it (i.e.: something such as `Header set X-UA-Compatible "IE=edge"`).
However, if the header is added from somewhere in the stack (e.g.
the framework level, language level such as PHP, etc.), and that
cannot be changed, you can try to remove it at the `Apache` level,
using the following:

```apache
<IfModule mod_headers.c>
Expand All @@ -304,7 +304,7 @@ Note that:
[using `.htaccess` files slows down][htaccess is slow] Apache!

If you don't have access to the main configuration file (quite
common with hosting services), just add the snippets in a `.htaccess`
common with hosting services), add the snippets in a `.htaccess`
file in the root of the web site/app.

</details>
Expand Down
2 changes: 1 addition & 1 deletion packages/rule-http-cache/README.md
Expand Up @@ -299,7 +299,7 @@ Also note that:
[using `.htaccess` files slows down][htaccess is slow] Apache!

If you don't have access to the main configuration file (quite
common with hosting services), just add the snippets in a `.htaccess`
common with hosting services), add the snippets in a `.htaccess`
file in the root of the web site/app.

</details>
Expand Down
12 changes: 6 additions & 6 deletions packages/rule-http-compression/README.md
Expand Up @@ -89,7 +89,7 @@ resources:

* Dealing with special cases.

One such special case is `SVGZ` files that are just `SVG` files
One such special case is `SVGZ` files that are `SVG` files
compressed with gzip. Since they are already compressed, they
shouldn't be compressed again. However sending them without the
`Content-Encoding: gzip` header will create problems as user agents
Expand Down Expand Up @@ -563,7 +563,7 @@ to conditionally compress with Brotli as well as add the
take more time. So, when provided, `mod_brotli` may be used to compress
dynamic resources (especially if set to use lower compression quality
levels), but for static resources it's indicated to compress them as
part of the build process and just configure Apache to serve those
part of the build process and configure Apache to serve those
pre-compressed resources whenever Brotli compression is requested over
HTTPS.

Expand Down Expand Up @@ -814,7 +814,7 @@ Also note that:
[using `.htaccess` files slows down][htaccess is slow] Apache!

If you don't have access to the main configuration file (quite
common with hosting services), just add the snippets in a `.htaccess`
common with hosting services), add the snippets in a `.htaccess`
file in the root of the web site/app.

</details>
Expand All @@ -830,9 +830,9 @@ configured to server those pre-compressed files when gzip compression is
requested by the user agent.

Brotli, like Zopfli, takes more time. It's indicated to compress
resources at build time, and configure IIS to just serve those
pre-compressed resources whenever Brotli compression is requested over
HTTPS by the user agent.
resources at build time, and configure IIS to serve those pre-compressed
resources whenever Brotli compression is requested over HTTPS by the
user agent.

If you don't want to start from scratch, below is a generic starter
snippet that contains the necessary configurations to ensure that
Expand Down
20 changes: 10 additions & 10 deletions packages/rule-http-compression/src/rule.ts
Expand Up @@ -402,20 +402,20 @@ export default class HttpCompressionRule implements IRule {
isCompressedWithBrotli(rawResponse) ||

/*
* Other compression methods may be used, but there is
* no way to check for all possible cases. So, if this
* point is reached, just consider 'content-encoding'
* header as a possible indication of the response being
* compressed.
* Other compression methods may be used, but there
* is no way to check for all possible cases. So, if
* this point is reached, consider 'content-encoding'
* header as a possible indication of the response
* being compressed.
*/

(contentEncodingHeaderValue &&

/*
* Although `identity` should not be sent as
* a value for `content-encoding`, if sent, for
* the * scope of this function, just ignore it
* and consider no encoding was specified.
* Although `identity` should not be sent as a value
* for `content-encoding`, if sent, for the scope of
* this function, ignore it and consider no encoding
* was specified.
*
* From (now kinda obsolete)
* https://tools.ietf.org/html/rfc2616#page-24:
Expand Down Expand Up @@ -460,7 +460,7 @@ export default class HttpCompressionRule implements IRule {
return;
}

// For anything else just flag it as disallowed.
// For anything else flag it as disallowed.
await context.report(resource, element, generateDisallowedCompressionMessage(encoding));
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/rule-image-optimization-cloudinary/README.md
Expand Up @@ -76,7 +76,7 @@ configuration from the [`.sonarwhalrc`][sonarwhalrc] file:
}
```

By default, this rule will notify you even if there is just 1kB savings.
By default, this rule will notify you even if there is a 1kB savings.
If you want to change the `threshold` you can do it by having something
as the following in the [`.sonarwhalrc`][sonarwhalrc] file:

Expand Down
12 changes: 6 additions & 6 deletions packages/rule-manifest-app-name/README.md
Expand Up @@ -11,11 +11,11 @@ spec] will use [`name`][manifest name] member (or the
to display the name of the app in various places across the OS such as
the list of apps installed, a app icon label etc.

If these members are not defined, browsers will try to get the name
from other sources such as the value of the [`application-name` meta
tag, `<title>`, or just default to a specific value (e.g.:
`Untitled`)][manifest metadata]. This can lead to a bad user experience,
as the app name may be truncated or just wrong.
If these members are not defined, browsers will try to get the
name from other sources such as the value of the [`application-name`
meta tag, `<title>`, or default to a specific value (e.g.:
`Untitled`)][manifest metadata]. This can lead to a bad user
experience, as the app name may be truncated or wrong.

It is recommended to specify the `name` member and keep it's length
under 30 characters, and if it’s over 12 characters, include a
Expand All @@ -24,7 +24,7 @@ under 30 characters, and if it’s over 12 characters, include a
Notes:

* If the `name` is under or 12 characters, there isn’t a need to
specify `short_name` as browsers can just use `name`.
specify `short_name` as browsers can use `name`.

* The 12 character limit is used to ensure that for most cases the
value won’t be truncated. However depending on [other things][sonarwhal
Expand Down
2 changes: 1 addition & 1 deletion packages/rule-meta-charset-utf-8/README.md
Expand Up @@ -10,7 +10,7 @@ by using the charset parameter on the `Content-Type` HTTP response
header (e.g.: `Content-Type: text/html; charset=utf-8`) and/or using
the charset meta tag in the file.

Sending just the `Content-Type` HTTP header is in general ok, but it’s
Sending the `Content-Type` HTTP header is in general ok, but it’s
usually a good idea to also add the charset meta tag because:

* Server configurations might change (or servers might not send the
Expand Down
2 changes: 1 addition & 1 deletion packages/rule-meta-viewport/src/rule.ts
Expand Up @@ -100,7 +100,7 @@ export default class MetaViewportRule implements IRule {
/*
* The following properties allow to block the user
* from zooming, behavior that most of the time results
* in accessibility problems or just annoying users.
* in accessibility problems or annoying users.
*
* Because of that, they are now ignored by browsers
* such as Safari for iOS 10+.
Expand Down
6 changes: 3 additions & 3 deletions packages/rule-no-disallowed-headers/README.md
Expand Up @@ -114,8 +114,8 @@ HTTP/... 200 OK
<details><summary>How to configure Apache</summary>

If the headers are sent, in most cases, to make Apache stop sending
them requires just removing the configurations that tells Apache to
add them (e.g. for the `X-UA-Compatible` header, that would be mean
them requires removing the configurations that tells Apache to add
them (e.g. for the `X-UA-Compatible` header, that would be mean
removing something such as `Header set X-UA-Compatible "IE=edge"`).
However, if the headers are added from somewhere in the stack (e.g.:
the framework level, language level such as PHP, etc.), and that cannot
Expand Down Expand Up @@ -166,7 +166,7 @@ Note that:
[using `.htaccess` files slows down][htaccess is slow] Apache!

If you don't have access to the main configuration file (quite
common with hosting services), just add the first snippets in a
common with hosting services), add the first snippets in a
`.htaccess` file in the root of the web site/app.

</details>
Expand Down
4 changes: 2 additions & 2 deletions packages/rule-no-html-only-headers/README.md
Expand Up @@ -7,7 +7,7 @@ are not needed for non-HTML resources.

Some HTTP headers do not make sense to be sent for non-HTML
resources, as sending them does not provide any value to users,
and just contributes to header bloat.
and contributes to header bloat.

## How to use this rule?

Expand Down Expand Up @@ -151,7 +151,7 @@ Note that:
[using `.htaccess` files slows down][htaccess is slow] Apache!

If you don't have access to the main configuration file (quite
common with hosting services), just add the snippets in a `.htaccess`
common with hosting services), add the snippets in a `.htaccess`
file in the root of the web site/app.

</details>
Expand Down
2 changes: 1 addition & 1 deletion packages/rule-performance-budget/src/connections.ts
Expand Up @@ -58,7 +58,7 @@ const getConnections = (): Array<NetworkConfig> => {

const configsText = configContent
.replace(/#.*?\n/g, '') // remove comments
.replace(/\r\n/g, '\n') // remove \r just in case the file has a windows EOL
.replace(/\r\n/g, '\n') // remove \r in case the file has a Windows EOL
.split(`\n\n`);

const configs = configsText.map(parseConnection);
Expand Down
19 changes: 13 additions & 6 deletions packages/rule-performance-budget/src/rule.ts
Expand Up @@ -125,7 +125,10 @@ export default class PerformanceBudgetRule implements IRule {
await updateSizes(resource, response);
};

/** Returns the details for the selected network configuration or the default one. */
/**
* Returns the details for the selected network
* configuration or the default one.
*/
const getConfiguration = (): NetworkConfig => {
const userConfig = Object.assign({}, defaultConfig, context.ruleOptions) as PerfBudgetConfig;
const config = Connections.getById(userConfig.connectionType);
Expand All @@ -152,10 +155,12 @@ export default class PerformanceBudgetRule implements IRule {
};

/**
* Calculates the minimum required time in seconds to establish all the TCP connections.
* Calculates the minimum required time in seconds to establish
* all the TCP connections.
*
* All TCP connections beging with a _Three-way handshake_, but clients can start sending application
* data after they receive the `ACK` message, si the delay is just 1 RTT:
* All TCP connections beging with a _Three-way handshake_, but
* clients can start sending application data after they receive
* the `ACK` message, if the delay is just 1 RTT:
*
* `time = connections * RTT`
*
Expand All @@ -169,7 +174,8 @@ export default class PerformanceBudgetRule implements IRule {
};

/**
* Calculates the minimum required time in seconds to do all the TLS handshaking of a website.
* Calculates the minimum required time in seconds to do all
* the TLS handshaking of a website.
*
* It assumes 1 RTT per TLS connection as an optimistic scenario.
* More info in: https://hpbn.co/transport-layer-security-tls/#tls-handshake
Expand All @@ -184,7 +190,8 @@ export default class PerformanceBudgetRule implements IRule {
};

/**
* Calculates the minimum required time in seconds to process all the redirects found.
* Calculates the minimum required time in seconds to process
* all the redirects found.
*
* The time for a redirect is 1 RTT
*/
Expand Down
2 changes: 1 addition & 1 deletion packages/rule-ssllabs/README.md
Expand Up @@ -6,7 +6,7 @@
## Why is this important?

> SSL/TLS is a deceptively simple technology. It is easy to deploy,
and it just works--except when it does not. The main problem is that
and it works--except when it does not. The main problem is that
encryption is not often easy to deploy correctly. To ensure that TLS
provides the necessary security, system administrators and developers
must put extra effort into properly configuring their servers and
Expand Down
2 changes: 1 addition & 1 deletion packages/rule-strict-transport-security/README.md
Expand Up @@ -171,7 +171,7 @@ Note that:
[using `.htaccess` files slows down][htaccess is slow] Apache!

If you don't have access to the main configuration file (quite
common with hosting services), just add the snippets in a `.htaccess`
common with hosting services), add the snippets in a `.htaccess`
file in the root of the web site/app.

</details>
Expand Down
@@ -1 +1 @@
This file is just to check that if there is no TypeScript config file, an event is 'parse::typescript-config::error::not-found' event is dispached.
This file is just to check that if there is no TypeScript config file, an event is 'parse::typescript-config::error::not-found' event is dispached.

0 comments on commit e543db4

Please sign in to comment.