Skip to content

Commit

Permalink
chore: update linting (#223)
Browse files Browse the repository at this point in the history
* chore(deps): remove unneeded devDependencies

* chore(deps): remove unneeded devDependencies

* chore: update rules

* chore: remove extraneous fixture

* chore: lint fixes

* chore: prettier

* chore: lint

* fix: update jest config

* fix: run build from cli

Co-authored-by: Matt Kane <[email protected]>
  • Loading branch information
XhmikosR and ascorbic authored Jan 21, 2022
1 parent 48f41ce commit ebfec8a
Show file tree
Hide file tree
Showing 66 changed files with 22,824 additions and 14,440 deletions.
23 changes: 22 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1 +1,22 @@
plugin/lib
plugin/lib
.netlify
fixtures/
demo

*~
*.swp
npm-debug.log
node_modules
/core
.eslintcache
.yarn-error.log
.nyc_output
!.github/
/coverage
/build
.netlify
/yarn.lock
.cache
public
.DS_Store
.parcel-cache
63 changes: 31 additions & 32 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,44 +2,43 @@ const { overrides } = require('@netlify/eslint-config-node')

module.exports = {
extends: '@netlify/eslint-config-node',
// TODO: remove after https://github.com/netlify/eslint-config-node/pull/230 is merged and released
rules: {
'node/no-unsupported-features/es-syntax': [
'error',
{
ignores: ['modules'],
},
],
'func-style': ['error', 'declaration'],
'import/no-dynamic-require': 'off',
// For now
'func-style': 'off',
// This is compiled, so we can use modern syntax
'node/no-unsupported-features/es-syntax': 'off',
// This is a duplicate of `import/no-duplicates` but can handle "import type"
'no-duplicate-imports': 'off',
},
env: {
jest: true,
},
parserOptions: {
sourceType: 'module',
},
overrides: [
...overrides,
// TODO: remove after https://github.com/netlify/eslint-config-node/pull/230 is merged and released
{
files: ['*.ts'],
extends: [
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:import/typescript',
],
},
],
settings: {
// TODO: remove after https://github.com/netlify/eslint-config-node/pull/230 is merged and released
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx'],
},
'import/resolver': {
node: {
extensions: ['.js', '.jsx', '.d.ts', '.ts', '.tsx'],
},
typescript: {
alwaysTryTypes: true,
// Tests use lots of nested callbacks
files: ['*-test.js', '*.spec.js', '**/e2e-tests/*.js'],
rules: {
'max-nested-callbacks': 'off',
},
},
node: {
tryExtensions: ['.js', '.ts', '.d.ts'],
{
// Templates import files from the site itself and needs lots of dynamic requires
files: ['plugin/src/templates/**/*'],
rules: {
'node/no-unpublished-import': 'off',
'@typescript-eslint/no-var-requires': 'off',
'node/global-require': 'off',
'import/no-dynamic-require': 'off',
'import/no-unresolved': 'off',
'node/no-unpublished-require': 'off',
'node/no-missing-require': 'off',
'max-lines': 'off',
'unicorn/filename-case': 'off',
},
},
},
],
}
20 changes: 20 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
plugin/lib
.netlify
*~
*.swp
npm-debug.log
node_modules
/core
.eslintcache
.yarn-error.log
.nyc_output
!.github/
/coverage
/build
.netlify
/yarn.lock
.cache
public
.DS_Store
.parcel-cache
node_modules
4 changes: 0 additions & 4 deletions ava.config.js

This file was deleted.

3 changes: 2 additions & 1 deletion demo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@

## 🚀 Quick start (Gatsby Cloud)

Deploy this starter with one click on [Gatsby Cloud](https://www.gatsbyjs.com/cloud/):
Deploy this starter with one click on
[Gatsby Cloud](https://www.gatsbyjs.com/cloud/):

[<img src="https://www.gatsbyjs.com/deploynow.svg" alt="Deploy to Gatsby Cloud">](https://www.gatsbyjs.com/dashboard/deploynow?url=https://github.com/gatsbyjs/gatsby-starter-minimal)
16 changes: 9 additions & 7 deletions demo/content/posts/hello-world/index.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Hello World
date: "2015-05-01T22:12:03.284Z"
description: "Hello World"
date: '2015-05-01T22:12:03.284Z'
description: 'Hello World'
---

This is my first post on my new fake blog! How exciting!
Expand All @@ -24,7 +24,7 @@ Oh, and here's a great quote from this Wikipedia on
You can also write code blocks here!

```js
const saltyDuckEgg = "chinese preserved food product"
const saltyDuckEgg = 'chinese preserved food product'
```

| Number | Title | Year |
Expand Down Expand Up @@ -87,7 +87,9 @@ This is a paragraph.
##### Header 5 #####
###### Header 6 ######

> Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.
> Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam hendrerit mi
> posuere lectus. Vestibulum enim wisi, viverra nec, fringilla in, laoreet
> vitae, risus.
> Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.

Expand Down Expand Up @@ -190,13 +192,13 @@ Paragraph:

---------------------------------------

This is [an example](http://example.com "Example") link.
This is [an example](http://example.com 'Example') link.

[This link](http://example.com) has no title attr.

This is [an example][id] reference-style link.

[id]: http://example.com "Optional Title"
[id]: http://example.com 'Optional Title'

This is [an example](http://example.com "Example") link.

Expand Down Expand Up @@ -226,6 +228,6 @@ This paragraph has some `code` in it.

This paragraph has some `code` in it.

![Alt Text](https://placehold.it/200x50 "Image Title")
![Alt Text](https://placehold.it/200x50 'Image Title')

![Alt Text](https://placehold.it/200x50 "Image Title")
2 changes: 1 addition & 1 deletion demo/content/posts/my-second-post/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: My Second Post!
date: "2015-05-06T23:46:37.121Z"
date: '2015-05-06T23:46:37.121Z'
---

Wow! I love blogging so much already.
Expand Down
6 changes: 4 additions & 2 deletions demo/content/posts/new-beginnings/index.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
---
title: New Beginnings
date: "2015-05-28T22:40:32.169Z"
description: This is a custom description for SEO and Open Graph purposes, rather than the default generated excerpt. Simply add a description field to the frontmatter.
date: '2015-05-28T22:40:32.169Z'
description:
This is a custom description for SEO and Open Graph purposes, rather than the
default generated excerpt. Simply add a description field to the frontmatter.
---

Far far away, behind the word mountains, far from the countries Vokalia and
Expand Down
1 change: 1 addition & 0 deletions demo/gatsby-node.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const path = require('path')

const slugify = require('@sindresorhus/slugify')

exports.createSchemaCustomization = function createSchemaCustomization({
Expand Down
Loading

0 comments on commit ebfec8a

Please sign in to comment.