Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating ESLint config #1577

Merged
merged 13 commits into from
Nov 22, 2023
21 changes: 21 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
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/weak-typescript',
gudmdharalds marked this conversation as resolved.
Show resolved Hide resolved
],
rules: {
camelcase: 'warn',
'jest/no-mocks-import': 'warn',
'no-await-in-loop': 'warn',
'no-unused-vars': 'warn',
gudmdharalds marked this conversation as resolved.
Show resolved Hide resolved
'no-console': 0,
'security/detect-object-injection': 0,
'security/detect-non-literal-fs-filename': 0,
'promise/no-multiple-resolved': 0,
},
root: true,
};
15 changes: 0 additions & 15 deletions .eslintrc.json

This file was deleted.

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

version: 2
updates:
- package-ecosystem: "npm" # See documentation for possible values
directory: "/" # Location of package manifests
- package-ecosystem: 'npm' # See documentation for possible values
gudmdharalds marked this conversation as resolved.
Show resolved Hide resolved
directory: '/' # Location of package manifests
schedule:
interval: "daily"
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
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
/__fixtures__/
/dist/
/flow-typed/
gudmdharalds marked this conversation as resolved.
Show resolved Hide resolved
/npm-shrinkwrap.json
/CONTRIBUTING.md
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The CONTRIBUTING.md file is here temporarily, this will be removed in #1559. This is to avoid conflict between those two PRs.

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