Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: Node CI

on: [push]
on:
push:
branches: [main]
pull_request:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: should this be this?

Suggested change
pull_request:
pull_request:
branches: [main]

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we only want it to run on PRs to main, you're right i think

i just thought we may as well run on all branches, but maybe thats excessive 🤔

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair point. Was mostly curious because I didn't know that you can leave anything after a colon in yaml empty.


jobs:
build:
Expand Down
58 changes: 8 additions & 50 deletions test/__snapshots__/index.test.mjs.snap
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ exports[`config: eslint.config.test.cjs > Fixture: component > invalid > fixture
"nodeType": "ClassDeclaration",
"ruleId": "react/prefer-stateless-function",
"severity": 1,
"suggestions": undefined,
},
{
"column": 2,
Expand All @@ -30,19 +31,7 @@ exports[`config: eslint.config.test.cjs > Fixture: component > invalid > fixture
"nodeType": "MethodDefinition",
"ruleId": "no-useless-constructor",
"severity": 1,
"suggestions": [
{
"desc": "Remove the constructor.",
"fix": {
"range": [
73,
102,
],
"text": "",
},
"messageId": "removeConstructor",
},
],
"suggestions": undefined,
},
],
"source": "import { Component } from 'preact';
Expand Down Expand Up @@ -94,6 +83,7 @@ exports[`config: eslint.config.test.cjs > Fixture: hooks > invalid > fixtures/ho
"nodeType": "Identifier",
"ruleId": "react-hooks/exhaustive-deps",
"severity": 1,
"suggestions": undefined,
},
{
"column": 5,
Expand All @@ -104,18 +94,7 @@ exports[`config: eslint.config.test.cjs > Fixture: hooks > invalid > fixtures/ho
"nodeType": "ArrayExpression",
"ruleId": "react-hooks/exhaustive-deps",
"severity": 1,
"suggestions": [
{
"desc": "Update the dependencies array to be: [value]",
"fix": {
"range": [
236,
238,
],
"text": "[value]",
},
},
],
"suggestions": undefined,
},
],
"source": "import { useState, useCallback, useEffect } from 'preact/hooks';
Expand Down Expand Up @@ -173,6 +152,7 @@ exports[`config: eslint.config.test.mjs > Fixture: component > invalid > fixture
"nodeType": "ClassDeclaration",
"ruleId": "react/prefer-stateless-function",
"severity": 1,
"suggestions": undefined,
},
{
"column": 2,
Expand All @@ -184,19 +164,7 @@ exports[`config: eslint.config.test.mjs > Fixture: component > invalid > fixture
"nodeType": "MethodDefinition",
"ruleId": "no-useless-constructor",
"severity": 1,
"suggestions": [
{
"desc": "Remove the constructor.",
"fix": {
"range": [
73,
102,
],
"text": "",
},
"messageId": "removeConstructor",
},
],
"suggestions": undefined,
},
],
"source": "import { Component } from 'preact';
Expand Down Expand Up @@ -248,6 +216,7 @@ exports[`config: eslint.config.test.mjs > Fixture: hooks > invalid > fixtures/ho
"nodeType": "Identifier",
"ruleId": "react-hooks/exhaustive-deps",
"severity": 1,
"suggestions": undefined,
},
{
"column": 5,
Expand All @@ -258,18 +227,7 @@ exports[`config: eslint.config.test.mjs > Fixture: hooks > invalid > fixtures/ho
"nodeType": "ArrayExpression",
"ruleId": "react-hooks/exhaustive-deps",
"severity": 1,
"suggestions": [
{
"desc": "Update the dependencies array to be: [value]",
"fix": {
"range": [
236,
238,
],
"text": "[value]",
},
},
],
"suggestions": undefined,
},
],
"source": "import { useState, useCallback, useEffect } from 'preact/hooks';
Expand Down
4 changes: 4 additions & 0 deletions test/index.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ async function lint (file, cli) {
return {
report: report.map((r) => ({
...r,
messages: r.messages.map((m) => ({
...m,
suggestions: undefined, // since ESLint 8 doesn't return these
})),
filePath: '<filePath>'
})),
...lintResults[0],
Expand Down