Skip to content

Commit

Permalink
Updating ESLint config (#1577)
Browse files Browse the repository at this point in the history
* Updating ESLint rules

* Updating formatting

* Updating formatting

* Adding format:check

* Update .eslintrc.js

* Update .eslintrc.js

* Update .prettierignore

* Update .eslintrc.js

Co-authored-by: Volodymyr Kolesnykov <[email protected]>

* Update .eslintrc.js

* Update .eslintrc.js

* Update dependabot.yml

* Update dependabot.yml

---------

Co-authored-by: Volodymyr Kolesnykov <[email protected]>
  • Loading branch information
gudmdharalds and sjinks authored Nov 22, 2023
1 parent a800826 commit dd0b0fc
Show file tree
Hide file tree
Showing 36 changed files with 1,460 additions and 1,279 deletions.
22 changes: 22 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
require( '@automattic/eslint-plugin-wpvip/init' );

module.exports = {
extends: [
'plugin:@automattic/wpvip/recommended',
'plugin:@automattic/wpvip/cli',
'plugin:@automattic/wpvip/weak-testing',
'plugin:@automattic/wpvip/typescript',
],
rules: {
camelcase: 'warn',
'jest/no-mocks-import': 'warn',
'no-await-in-loop': 'warn',
'no-console': 0,
'security/detect-object-injection': 0,
'security/detect-non-literal-fs-filename': 0,
'promise/no-multiple-resolved': 0,
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': 'warn',
},
root: true,
};
15 changes: 0 additions & 15 deletions .eslintrc.json

This file was deleted.

20 changes: 17 additions & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,24 @@

version: 2
updates:
- package-ecosystem: "npm" # See documentation for possible values
directory: "/" # Location of package manifests
# Enable version updates for npm
- package-ecosystem: 'npm' # See documentation for possible values
directory: '/' # Location of package manifests
schedule:
interval: "daily"
interval: 'daily'
reviewers:
- 'Automattic/vip-platform-patisserie'
labels:
- '[Status] Needs Review'
- 'dependencies'
# Allow up to 15 open pull requests at the same time
open-pull-requests-limit: 15

# Enable version updates for GitHub Actions
- package-ecosystem: 'github-actions' # See documentation for possible values
directory: '/' # Location of package manifests
schedule:
interval: 'daily'
reviewers:
- 'Automattic/vip-platform-patisserie'
labels:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
config:
- { name: Lint, tool: lint }
- { name: Type Checker, tool: check-types }
- { name: Check formatting, tool: 'format:check' }
steps:
- name: Check out the source code
uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/npm-prepare-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
pull-requests: write
steps:
- name: Check out the source code
uses: actions/checkout@v3
Expand Down
3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/CHANGELOG.md
/__fixtures__/
/dist/
/flow-typed/
/npm-shrinkwrap.json
/CONTRIBUTING.md
12 changes: 6 additions & 6 deletions src/lib/app-slowlogs/app-slowlogs.generated.d.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import * as Types from '../../../graphqlTypes';

export type GetAppSlowlogsQueryVariables = Types.Exact<{
appId?: Types.InputMaybe<Types.Scalars['Int']['input']>;
envId?: Types.InputMaybe<Types.Scalars['Int']['input']>;
limit?: Types.InputMaybe<Types.Scalars['Int']['input']>;
after?: Types.InputMaybe<Types.Scalars['String']['input']>;
}>;
export type GetAppSlowlogsQueryVariables = Types.Exact< {
appId?: Types.InputMaybe< Types.Scalars[ 'Int' ][ 'input' ] >;
envId?: Types.InputMaybe< Types.Scalars[ 'Int' ][ 'input' ] >;
limit?: Types.InputMaybe< Types.Scalars[ 'Int' ][ 'input' ] >;
after?: Types.InputMaybe< Types.Scalars[ 'String' ][ 'input' ] >;
} >;
20 changes: 4 additions & 16 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"lib": ["es2021"],
"lib": [ "es2021" ],
"module": "node16",
"strict": true,
"esModuleInterop": true,
Expand All @@ -21,23 +21,11 @@
"resolveJsonModule": true,
"baseUrl": ".",
"paths": {
"*": [
"./types/*",
"./node_modules/@types/node/*"
]
"*": [ "./types/*", "./node_modules/@types/node/*" ]
},
// It's worth enabling this, I promise!
"noImplicitAny": true
},
"include": [
"src",
"helpers",
"config",
"__tests__",
"__fixtures__"
],
"exclude": [
"**/*.js",
"codegen.ts"
]
"include": [ "src", "helpers", "config", "__tests__", "__fixtures__" ],
"exclude": [ "**/*.js", "codegen.ts" ]
}
2 changes: 1 addition & 1 deletion types/enquirer/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ declare namespace Enquirer {
} & SelectQuestionOptionsBase;
export type SelectQuestionOptionsBase = {
choices: SelectQuestion.Choice[];
} & Omit<types.QuestionBase, 'initial'> &
} & Omit< types.QuestionBase, 'initial' > &
types.Initializer< string | number, string > &
types.Formatter< string, string >;

Expand Down
11 changes: 7 additions & 4 deletions types/lando/lib/app.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { LandoConfig } from "./lando";
import { LandoConfig } from './lando';

export = App;

Expand Down Expand Up @@ -70,9 +70,12 @@ declare class App {
engine: any;
metrics: any;
Promise: any;
events: import("lando/lib/events");
events: import('lando/lib/events');
urls: ScanResult[] | undefined;
scanUrls: (urls: string[], options?: { max?: number, waitCodes?: number[] }) => Promise<ScanResult[]>;
scanUrls: (
urls: string[],
options?: { max?: number; waitCodes?: number[] }
) => Promise< ScanResult[] >;
/**
* The apps configuration
*
Expand All @@ -92,7 +95,7 @@ declare class App {
*/
info: ServiceInfo[];
labels: any;
opts: Record<string, any>;
opts: Record< string, any >;
plugins: any;
metaCache: string;
meta: any;
Expand Down
87 changes: 46 additions & 41 deletions types/lando/lib/art.d.ts
Original file line number Diff line number Diff line change
@@ -1,44 +1,49 @@
export function appDestroy({ name, phase }?: {
name: any;
phase?: string;
}): any;
export function appRebuild({ name, phase, warnings }?: {
name: any;
phase?: string;
warnings?: {};
}): any;
export function appRestart({ name, phase, warnings }?: {
name: any;
phase?: string;
warnings?: {};
}): any;
export function appStart({ name, phase, warnings }?: {
name: any;
phase?: string;
warnings?: {};
}): any;
export function appStop({ name, phase }?: {
name: any;
phase?: string;
}): any;
export function appDestroy( { name, phase }?: { name: any; phase?: string } ): any;
export function appRebuild( {
name,
phase,
warnings,
}?: {
name: any;
phase?: string;
warnings?: {};
} ): any;
export function appRestart( {
name,
phase,
warnings,
}?: {
name: any;
phase?: string;
warnings?: {};
} ): any;
export function appStart( {
name,
phase,
warnings,
}?: {
name: any;
phase?: string;
warnings?: {};
} ): any;
export function appStop( { name, phase }?: { name: any; phase?: string } ): any;
export function crash(): string;
export function experimental(on?: boolean): string;
export function experimental( on?: boolean ): string;
export function init(): string;
export function newContent(type?: string): string;
export function noDockerDep(dep?: string): string;
export function poweroff({ phase }?: {
phase?: string;
}): any;
export function print({ text, color }?: {
text: any;
color?: string;
}): any;
export function printFont({ text, color, font }?: {
text: any;
color?: string;
font?: string;
}): any;
export function releaseChannel(channel?: string): string;
export function secretToggle(on?: boolean): string;
export function secretToggleDenied(on?: boolean): string;
export function newContent( type?: string ): string;
export function noDockerDep( dep?: string ): string;
export function poweroff( { phase }?: { phase?: string } ): any;
export function print( { text, color }?: { text: any; color?: string } ): any;
export function printFont( {
text,
color,
font,
}?: {
text: any;
color?: string;
font?: string;
} ): any;
export function releaseChannel( channel?: string ): string;
export function secretToggle( on?: boolean ): string;
export function secretToggleDenied( on?: boolean ): string;
export function badToken(): string;
42 changes: 29 additions & 13 deletions types/lando/lib/bootstrap.d.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,30 @@
import { LandoConfig } from "./lando";
import { LandoConfig } from './lando';

export function buildConfig(options: Partial<LandoConfig>): LandoConfig;
export function dc(shell: any, bin: any, cmd: any, { compose, project, opts }: {
compose: any;
project: any;
opts?: {};
}): any;
export function getApp(files: any, userConfRoot: any): any;
export function getLandoFiles(files?: any[], startFrom?: string): any;
export function getTasks(config?: {}, argv?: {}, tasks?: any[]): any[];
export function setupCache(log: any, config: any): import("lando/lib/cache");
export function setupEngine(config: any, cache: any, events: any, log: any, shell: any, id: any): import("lando/lib/engine");
export function setupMetrics(log: any, config: any): import("lando/lib/metrics");
export function buildConfig( options: Partial< LandoConfig > ): LandoConfig;
export function dc(
shell: any,
bin: any,
cmd: any,
{
compose,
project,
opts,
}: {
compose: any;
project: any;
opts?: {};
}
): any;
export function getApp( files: any, userConfRoot: any ): any;
export function getLandoFiles( files?: any[], startFrom?: string ): any;
export function getTasks( config?: {}, argv?: {}, tasks?: any[] ): any[];
export function setupCache( log: any, config: any ): import('lando/lib/cache');
export function setupEngine(
config: any,
cache: any,
events: any,
log: any,
shell: any,
id: any
): import('lando/lib/engine');
export function setupMetrics( log: any, config: any ): import('lando/lib/metrics');
Loading

0 comments on commit dd0b0fc

Please sign in to comment.