Skip to content

Commit

Permalink
chore(formatting): added prettier to pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
Viijay-Kr committed Oct 11, 2024
1 parent 4c82152 commit ef1479d
Show file tree
Hide file tree
Showing 30 changed files with 330 additions and 271 deletions.
2 changes: 1 addition & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"privatePackages":{
"privatePackages": {
"tag": true,
"version": true
},
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ jobs:
with:
node-version: 16.x
- run: npm install
- run: npm run format:check
- run: xvfb-run -a npm test
if: runner.os == 'Linux'
- run: npm test
Expand Down
7 changes: 7 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
examples
dist
out
node_modules
.github
scripts
.vscode
3 changes: 3 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"singleQuote": false
}
10 changes: 5 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ If you find an issue/bug in the extension please use the bug report template

If you would like to request a feature please use the feature request template


## Code Contribution

Before making any code level contributions, please open a issue if the contribution is major

If a contribution is minor such as doc updates or typo fix feel free to open a PR from your fork to `main`
If a contribution is minor such as doc updates or typo fix feel free to open a PR from your fork to `main`

## Getting Started

To debug the extension locally follow the below steps
To debug the extension locally follow the below steps

1. Clone the repo. `cd` into the project
2. run `npm install` in your favourite terminal
Expand All @@ -22,5 +22,5 @@ To debug the extension locally follow the below steps

To debug the tests I strongly recommend to follow this [guide](https://code.visualstudio.com/api/working-with-extensions/testing-extension#debugging-the-tests)

> Its better not to run tests locally in command line as it downloads a copy VS code and it might conflict with the version of VS code installed in your machine.
> Using VS code debugger to run the tests is more than sufficient and offers good experience
> Its better not to run tests locally in command line as it downloads a copy VS code and it might conflict with the version of VS code installed in your machine.
> Using VS code debugger to run the tests is more than sufficient and offers good experience
65 changes: 55 additions & 10 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,8 @@
"pretest": "npm run compile-tests && npm run compile && npm run lint",
"lint": "eslint src --ext ts",
"lint:fix": "eslint src --fix --ext ts",
"format:check": "prettier . --check",
"format:fix": "prettier . --write",
"test": "node ./out/test/runTest.js",
"publish:vscode": "vsce publish",
"publish:openvsx": "ovsx publish",
Expand Down Expand Up @@ -201,6 +203,7 @@
"json5": "^2.2.3",
"mocha": "^10.0.0",
"ovsx": "^0.8.3",
"prettier": "^3.3.3",
"sinon": "^14.0.1",
"ts-loader": "^9.3.1",
"typescript": "^4.9.4",
Expand Down
16 changes: 8 additions & 8 deletions src/api/git.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,10 +209,10 @@ export interface Repository {

getObjectDetails(
treeish: string,
path: string
path: string,
): Promise<{ mode: string; object: string; size: number }>;
detectObjectType(
object: string
object: string,
): Promise<{ mimetype: string; encoding?: string }>;
buffer(ref: string, path: string): Promise<Buffer>;
show(ref: string, path: string): Promise<string>;
Expand Down Expand Up @@ -243,14 +243,14 @@ export interface Repository {
getBranch(name: string): Promise<Branch>;
getBranches(
query: BranchQuery,
cancellationToken?: CancellationToken
cancellationToken?: CancellationToken,
): Promise<Ref[]>;
getBranchBase(name: string): Promise<Branch | undefined>;
setBranchUpstream(name: string, upstream: string): Promise<void>;

getRefs(
query: RefQuery,
cancellationToken?: CancellationToken
cancellationToken?: CancellationToken,
): Promise<Ref[]>;

getMergeBase(ref1: string, ref2: string): Promise<string | undefined>;
Expand All @@ -272,7 +272,7 @@ export interface Repository {
remoteName?: string,
branchName?: string,
setUpstream?: boolean,
force?: ForcePushMode
force?: ForcePushMode,
): Promise<void>;

blame(path: string): Promise<string>;
Expand Down Expand Up @@ -322,7 +322,7 @@ export interface PushErrorHandler {
repository: Repository,
remote: Remote,
refspec: string,
error: Error & { gitErrorCode: GitErrorCodes }
error: Error & { gitErrorCode: GitErrorCodes },
): Promise<boolean>;
}

Expand Down Expand Up @@ -366,12 +366,12 @@ export interface API {
registerRemoteSourceProvider(provider: RemoteSourceProvider): Disposable;
registerCredentialsProvider(provider: CredentialsProvider): Disposable;
registerPostCommitCommandsProvider(
provider: PostCommitCommandsProvider
provider: PostCommitCommandsProvider,
): Disposable;
registerPushErrorHandler(handler: PushErrorHandler): Disposable;
registerBranchProtectionProvider(
root: Uri,
provider: BranchProtectionProvider
provider: BranchProtectionProvider,
): Disposable;
}

Expand Down
10 changes: 5 additions & 5 deletions src/css-node.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export declare enum ReferenceType {
}
export declare function getNodeAtOffset(
node: Node,
offset: number
offset: number,
): Node | null;
export declare function getNodePath(node: Node, offset: number): Node[];
export declare function getParentDeclaration(node: Node): Declaration | null;
Expand Down Expand Up @@ -240,7 +240,7 @@ export declare class Declaration extends AbstractDeclaration {
setValue(value: Expression | null): value is Expression;
getValue(): Expression | undefined;
setNestedProperties(
value: NestedProperties | null
value: NestedProperties | null,
): value is NestedProperties;
getNestedProperties(): NestedProperties | undefined;
}
Expand Down Expand Up @@ -303,7 +303,7 @@ export declare class IfStatement extends BodyDeclaration {
get type(): NodeType;
setExpression(node: Expression | null): node is Expression;
setElseClause(
elseClause: BodyDeclaration | null
elseClause: BodyDeclaration | null,
): elseClause is BodyDeclaration;
}
export declare class ForStatement extends BodyDeclaration {
Expand Down Expand Up @@ -579,7 +579,7 @@ export declare class MixinReference extends Node {
getName(): string;
getArguments(): Nodelist;
setContent(
node: MixinContentDeclaration | null
node: MixinContentDeclaration | null,
): node is MixinContentDeclaration;
getContent(): MixinContentDeclaration | undefined;
}
Expand Down Expand Up @@ -659,7 +659,7 @@ export declare class Marker implements IMarker {
level: Level,
message?: string,
offset?: number,
length?: number
length?: number,
);
getRule(): IRule;
getLevel(): Level;
Expand Down
24 changes: 12 additions & 12 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,57 +127,57 @@ export async function activate(context: ExtensionContext): Promise<void> {
await Store.bootstrap();
const _definitionProvider = languages.registerDefinitionProvider(
documentSelector,
new DefnitionProvider()
new DefnitionProvider(),
);
const _hoverProvider = languages.registerHoverProvider(
documentSelector,
new HoverProvider()
new HoverProvider(),
);
const _selectorsCompletionProvider =
languages.registerCompletionItemProvider(
documentSelector,
new SelectorsCompletionProvider(),
".",
"'",
"["
"[",
);
const _importsCompletionProvider = languages.registerCompletionItemProvider(
documentSelector,
new ImportCompletionProvider()
new ImportCompletionProvider(),
);
const _codeActionsProvider = languages.registerCodeActionsProvider(
documentSelector,
new DiagnosticCodeAction(context)
new DiagnosticCodeAction(context),
);

const _cssVariablesCompletion = languages.registerCompletionItemProvider(
cssDocumentSelector,
new CssVariablesCompletion(),
"-"
"-",
);

const _cssColorProviders = languages.registerColorProvider(
cssDocumentSelector,
new CssDocumentColorProvider()
new CssDocumentColorProvider(),
);

const _cssDefinitionProvider = languages.registerDefinitionProvider(
cssDocumentSelector,
new CssDefinitionProvider()
new CssDefinitionProvider(),
);

const _cssReferenceProvider = languages.registerReferenceProvider(
cssModulesDocumentSelector,
new ReferenceProvider()
new ReferenceProvider(),
);

const _cssCodeLensProvider = languages.registerCodeLensProvider(
cssModulesDocumentSelector,
new ReferenceCodeLensProvider()
new ReferenceCodeLensProvider(),
);
const _cssRenameSelectorProvider = languages.registerRenameProvider(
cssModulesDocumentSelector,
new RenameSelectorProvider()
new RenameSelectorProvider(),
);

context.subscriptions.push(_selectorsCompletionProvider);
Expand All @@ -194,7 +194,7 @@ export async function activate(context: ExtensionContext): Promise<void> {
} catch (e) {
Store.outputChannel.error((e as Error).message);
window.showWarningMessage(
"Something went wrong while activating React-TS-CSS extension. Check the output channel"
"Something went wrong while activating React-TS-CSS extension. Check the output channel",
);
}
}
Expand Down
Loading

0 comments on commit ef1479d

Please sign in to comment.