Skip to content

Commit

Permalink
Fix styles using eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
paulbalandan committed Nov 20, 2022
1 parent e6def87 commit 65ec34c
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
dist/
node_modules/
jest.config.js
jest.config.ts
10 changes: 9 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"project": "./tsconfig.json"
},
"rules": {
"filenames/match-regex": [2, "^[a-z_.]+$", true],
"i18n-text/no-en": "off",
"eslint-comments/no-use": "off",
"import/no-namespace": "off",
Expand Down Expand Up @@ -61,12 +62,19 @@
"@typescript-eslint/require-array-sort-compare": "error",
"@typescript-eslint/restrict-plus-operands": "error",
"semi": "off",
"sort-imports": ["error", {
"ignoreCase": false,
"ignoreDeclarationSort": false,
"ignoreMemberSort": false,
"memberSyntaxSortOrder": ["none", "all", "multiple", "single"],
"allowSeparatedGroups": false
}],
"@typescript-eslint/semi": [
"error",
"never"
],
"@typescript-eslint/type-annotation-spacing": "error",
"@typescript-eslint/unbound-method": "error"
"@typescript-eslint/unbound-method": "off"
},
"env": {
"node": true,
Expand Down
10 changes: 5 additions & 5 deletions __tests__/main.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { afterEach, beforeEach, describe, expect, it, jest } from '@jest/globals'
import * as github from '@actions/github'
import { runner } from '../src/runner'
import { afterEach, beforeEach, describe, expect, it, jest } from '@jest/globals'
import { EOL } from 'os'
import { runner } from '../src/runner'

describe('nexusphp/no-merge-commits main', () => {
beforeEach(() => {
Expand Down Expand Up @@ -45,7 +45,7 @@ describe('nexusphp/no-merge-commits main', () => {

it('fails when status code is not HTTP 200', async () => {
jest.spyOn(github, 'getOctokit').mockImplementation(
jest.fn<ReturnType<any>>((token: string) => {
jest.fn<ReturnType<any>>(() => {
return {
rest: {
pulls: {
Expand Down Expand Up @@ -77,7 +77,7 @@ describe('nexusphp/no-merge-commits main', () => {

it('succeeds checking no merge commits', async () => {
jest.spyOn(github, 'getOctokit').mockImplementation(
jest.fn<ReturnType<any>>((token: string) => {
jest.fn<ReturnType<any>>(() => {
return {
rest: {
pulls: {
Expand Down Expand Up @@ -124,7 +124,7 @@ describe('nexusphp/no-merge-commits main', () => {

it('fails when a merge commit is detected', async () => {
jest.spyOn(github, 'getOctokit').mockImplementation(
jest.fn<ReturnType<any>>((token: string) => {
jest.fn<ReturnType<any>>(() => {
return {
rest: {
pulls: {
Expand Down
2 changes: 1 addition & 1 deletion __tests__/util.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { afterEach, beforeEach, describe, expect, jest, test } from '@jest/globals'
import { color, inflect, log } from '../src/util'
import { EOL } from 'os'
import { color, log, inflect } from '../src/util'

describe('nexusphp/no-merge-commits util', () => {
beforeEach(() => {
Expand Down
2 changes: 1 addition & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ExitCode } from '@actions/core'
import { runner } from './runner'
import { log } from './util'
import { runner } from './runner'

/** Runner */
;(async () => {
Expand Down
2 changes: 1 addition & 1 deletion src/runner.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { getInput } from '@actions/core'
import { context, getOctokit } from '@actions/github'
import { inflect, log } from './util'
import { getInput } from '@actions/core'

export async function runner(): Promise<void> {
log('Collecting token from input...', 'notice')
Expand Down

0 comments on commit 65ec34c

Please sign in to comment.