Skip to content

Commit

Permalink
style: default prettier options (#121)
Browse files Browse the repository at this point in the history
  • Loading branch information
evilebottnawi authored Nov 25, 2020
1 parent 6271fc4 commit 0191b77
Show file tree
Hide file tree
Showing 25 changed files with 2,201 additions and 2,957 deletions.
6 changes: 3 additions & 3 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
module.exports = {
root: true,
extends: ['@webpack-contrib/eslint-config-webpack', 'prettier'],
extends: ["@webpack-contrib/eslint-config-webpack", "prettier"],
overrides: [
{
globals: {
globalThis: 'readonly',
globalThis: "readonly",
},
env: {
browser: true,
node: true,
},
files: ['**/runtime/**/*.js'],
files: ["**/runtime/**/*.js"],
},
],
};
1 change: 0 additions & 1 deletion .prettierrc.js

This file was deleted.

80 changes: 40 additions & 40 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ The documentation and syntax examples can be read [here](#syntax).
> `%20` is space in a query string, because you can't use spaces in URLs
```js
import $ from 'expose-loader?exposes[]=$&exposes[]=jQuery!jquery';
import $ from "expose-loader?exposes[]=$&exposes[]=jQuery!jquery";
//
// Adds the `jquery` to the global object under the names `$` and `jQuery`
```

```js
import { concat } from 'expose-loader?exposes=_.concat!lodash/concat';
import { concat } from "expose-loader?exposes=_.concat!lodash/concat";
//
// Adds the `lodash/concat` to the global object under the name `_.concat`
```
Expand All @@ -51,7 +51,7 @@ import { concat } from 'expose-loader?exposes=_.concat!lodash/concat';
import {
map,
reduce,
} from 'expose-loader?exposes[]=_.map|map&exposes[]=_.reduce|reduce!underscore';
} from "expose-loader?exposes[]=_.map|map&exposes[]=_.reduce|reduce!underscore";
//
// Adds the `map` and `reduce` method from `underscore` to the global object under the name `_.map` and `_.reduce`
```
Expand All @@ -61,7 +61,7 @@ import {
**src/index.js**

```js
import $ from 'jquery';
import $ from "jquery";
```

**webpack.config.js**
Expand All @@ -71,25 +71,25 @@ module.exports = {
module: {
rules: [
{
test: require.resolve('jquery'),
loader: 'expose-loader',
test: require.resolve("jquery"),
loader: "expose-loader",
options: {
exposes: ['$', 'jQuery'],
exposes: ["$", "jQuery"],
},
},
{
test: require.resolve('underscore'),
loader: 'expose-loader',
test: require.resolve("underscore"),
loader: "expose-loader",
options: {
exposes: [
'_.map|map',
"_.map|map",
{
globalName: '_.reduce',
moduleLocalName: 'reduce',
globalName: "_.reduce",
moduleLocalName: "reduce",
},
{
globalName: ['_', 'filter'],
moduleLocalName: 'filter',
globalName: ["_", "filter"],
moduleLocalName: "filter",
},
],
},
Expand Down Expand Up @@ -137,7 +137,7 @@ If `moduleLocalName` is not specified, it exposes the entire module to the globa
**src/index.js**

```js
import _ from 'underscore';
import _ from "underscore";
```

**webpack.config.js**
Expand All @@ -147,11 +147,11 @@ module.exports = {
module: {
rules: [
{
test: require.resolve('jquery'),
loader: 'expose-loader',
test: require.resolve("jquery"),
loader: "expose-loader",
options: {
// For `underscore` library, it can be `_.map map` or `_.map|map`
exposes: 'jquery',
exposes: "jquery",
},
},
],
Expand All @@ -173,7 +173,7 @@ The name in the global object. (**required**).
**src/index.js**

```js
import _ from 'underscore';
import _ from "underscore";
```

**webpack.config.js**
Expand All @@ -183,13 +183,13 @@ module.exports = {
module: {
rules: [
{
test: require.resolve('underscore'),
loader: 'expose-loader',
test: require.resolve("underscore"),
loader: "expose-loader",
options: {
exposes: {
// Can be `['_', 'filter']`
globalName: '_.filter',
moduleLocalName: 'filter',
globalName: "_.filter",
moduleLocalName: "filter",
},
},
},
Expand All @@ -209,7 +209,7 @@ If `moduleLocalName` is specified, it exposes only the value of `moduleLocalName
**src/index.js**

```js
import _ from 'underscore';
import _ from "underscore";
```

**webpack.config.js**
Expand All @@ -219,12 +219,12 @@ module.exports = {
module: {
rules: [
{
test: require.resolve('underscore'),
loader: 'expose-loader',
test: require.resolve("underscore"),
loader: "expose-loader",
options: {
exposes: {
globalName: '_.filter',
moduleLocalName: 'filter',
globalName: "_.filter",
moduleLocalName: "filter",
},
},
},
Expand All @@ -247,7 +247,7 @@ To force override the value that is already present in the global object you can
**src/index.js**

```js
import $ from 'jquery';
import $ from "jquery";
```

**webpack.config.js**
Expand All @@ -257,11 +257,11 @@ module.exports = {
module: {
rules: [
{
test: require.resolve('jquery'),
loader: 'expose-loader',
test: require.resolve("jquery"),
loader: "expose-loader",
options: {
exposes: {
globalName: '$',
globalName: "$",
override: true,
},
},
Expand All @@ -276,7 +276,7 @@ module.exports = {
**src/index.js**

```js
import _ from 'underscore';
import _ from "underscore";
```

**webpack.config.js**
Expand All @@ -286,18 +286,18 @@ module.exports = {
module: {
rules: [
{
test: require.resolve('underscore'),
loader: 'expose-loader',
test: require.resolve("underscore"),
loader: "expose-loader",
options: {
exposes: [
'_.map map',
"_.map map",
{
globalName: '_.filter',
moduleLocalName: 'filter',
globalName: "_.filter",
moduleLocalName: "filter",
},
{
globalName: ['_', 'find'],
moduleLocalName: 'myNameForFind',
globalName: ["_", "find"],
moduleLocalName: "myNameForFind",
},
],
},
Expand Down
10 changes: 5 additions & 5 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,23 @@ module.exports = (api) => {
return {
presets: [
[
'@babel/preset-env',
"@babel/preset-env",
{
targets: {
node: '10.13.0',
node: "10.13.0",
},
},
],
],
overrides: [
{
test: './src/runtime',
test: "./src/runtime",
presets: [
[
'@babel/preset-env',
"@babel/preset-env",
{
targets: {
node: '0.12',
node: "0.12",
},
},
],
Expand Down
2 changes: 1 addition & 1 deletion commitlint.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports = {
extends: ['@commitlint/config-conventional'],
extends: ["@commitlint/config-conventional"],
};
4 changes: 2 additions & 2 deletions husky.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
hooks: {
'pre-commit': 'lint-staged',
'commit-msg': 'commitlint -E HUSKY_GIT_PARAMS',
"pre-commit": "lint-staged",
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
},
};
4 changes: 2 additions & 2 deletions lint-staged.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = {
'*.js': ['prettier --write', 'eslint --fix'],
'*.{json,md,yml,css,ts}': ['prettier --write'],
"*.js": ["eslint --fix", "prettier --write"],
"*.{json,md,yml,css,ts}": ["prettier --write"],
};
Loading

0 comments on commit 0191b77

Please sign in to comment.