Skip to content

Commit

Permalink
Add Prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
jhnns committed Jan 27, 2022
1 parent fc3e3cb commit 2a7e8c1
Show file tree
Hide file tree
Showing 20 changed files with 1,267 additions and 182 deletions.
19 changes: 13 additions & 6 deletions .eslintrc.json
@@ -1,10 +1,17 @@
{
"extends": [
// Base rules for every project
"peerigon",
"peerigon/node",
"prettier" // add this at the end of 'extends' if you're using Prettier
// Base rules for every project
"peerigon",
"peerigon/node",
"prettier" // add this at the end of 'extends' if you're using Prettier
],
// Do not search for further eslint configs in upper directories
"root": true
}
"root": true,
"rules": {
// Temporarily disabling the following rules since they seem to have problems with ESMs
"import/no-unresolved": "off",
"node/no-missing-import": "off",
// According to Node's documentation, import() is supported in Node 12.22.9
"node/no-unsupported-features/es-syntax": "off"
}
}
3 changes: 2 additions & 1 deletion .gitignore
@@ -1,3 +1,4 @@
.idea
node_modules
.eslintcache
.eslintcache
test/output
1 change: 1 addition & 0 deletions .husky/.gitignore
@@ -0,0 +1 @@
_
4 changes: 4 additions & 0 deletions .husky/pre-commit
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx lint-staged
7 changes: 7 additions & 0 deletions .vscode/settings.json
@@ -0,0 +1,7 @@
{
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
}
}
7 changes: 5 additions & 2 deletions CHANGELOG.md
@@ -1,5 +1,4 @@
Changelog
---------
## Changelog

### 7.0.0

Expand Down Expand Up @@ -32,20 +31,24 @@ Changelog
- **Breaking** marked@0.5.0 @robcresswell [Changelog](https://github.com/markedjs/marked/releases/tag/v0.5.0)

### 3.0.0

- Update dependencies
- **Breaking** marked@4.0.0 (@hpohlmeyer) [Changelog](https://github.com/markedjs/marked/releases/tag/0.4.0)
- use webpack 4.x for tests
- update example to use npm version of `markdown-loader`

### 2.0.2

- Update dependencies
- marked@0.3.9 (@xuopled)

### 2.0.1

- Update dependencies
- loader-utils@1.1.0 (@kommander)

### 2.0.0

- **Breaking:** Drop Node.js 0.12 support
- **Breaking:** Drop support for custom config key (webpack 1)
- Update documentation for webpack 2
Expand Down
78 changes: 41 additions & 37 deletions README.md
@@ -1,5 +1,4 @@
markdown-loader
===============
# markdown-loader

markdown-loader for webpack using [marked](https://github.com/markedjs/marked).

Expand All @@ -13,7 +12,7 @@ markdown-loader for webpack using [marked](https://github.com/markedjs/marked).

`npm install markdown-loader`

## [Changelog](CHANGELOG.md)
## [Changelog](CHANGELOG.md)

## Usage

Expand All @@ -23,22 +22,24 @@ Since marked's output is HTML, it's best served in conjunction with the [html-lo

```javascript
{
module: {
rules: [{
test: /\.md$/,
use: [
{
loader: "html-loader"
},
{
loader: "markdown-loader",
options: {
/* your options here */
}
}
]
}]
}
module: {
rules: [
{
test: /\.md$/,
use: [
{
loader: "html-loader",
},
{
loader: "markdown-loader",
options: {
/* your options here */
},
},
],
},
];
}
}
```

Expand All @@ -54,25 +55,28 @@ const marked = require("marked");
const renderer = new marked.Renderer();

module.exports = {
module: {
rules: [{
test: /\.md$/,
use: [
{
loader: "html-loader"
},
{
loader: "markdown-loader",
options: {
pedantic: true,
renderer
}
}
]
}]
}
}
module: {
rules: [
{
test: /\.md$/,
use: [
{
loader: "html-loader",
},
{
loader: "markdown-loader",
options: {
pedantic: true,
renderer,
},
},
],
},
],
},
};
```

## License

MIT (http://www.opensource.org/licenses/mit-license.php)
Expand Down
3 changes: 3 additions & 0 deletions ava.config.js
@@ -0,0 +1,3 @@
export default {
files: ["test/**/*.js"],
};
3 changes: 0 additions & 3 deletions ava.config.mjs

This file was deleted.

0 comments on commit 2a7e8c1

Please sign in to comment.