Skip to content

Commit

Permalink
Remove custom eslint/prettier single quote configuration (ansible#262)
Browse files Browse the repository at this point in the history
* Remove custom prettier singleQuote option

Fixes: ansible/team-devtools#28

* chore: auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
ssbarnea and pre-commit-ci[bot] committed Mar 14, 2022
1 parent 7f16994 commit 592c597
Show file tree
Hide file tree
Showing 41 changed files with 967 additions and 969 deletions.
3 changes: 1 addition & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"plugins": ["@typescript-eslint"],
"rules": {
"eqeqeq": ["error", "smart"],
"prefer-template": "warn",
"quotes": ["warn", "single"]
"prefer-template": "warn"
}
}
1 change: 0 additions & 1 deletion .prettierrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,3 @@ overrides:
# compatibility with markdownlint
proseWrap: always
semi: true
singleQuote: true
10 changes: 5 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ https://github.com/ansible/ansible-language-server/tree/main/docs/changelog-frag

[vscode-ansible#373]:
https://github.com/ansible/vscode-ansible/issues/373
'{issue}`236`'
"{issue}`236`"

## v0.5.0 (2022-03-01)

Expand All @@ -62,7 +62,7 @@ https://github.com/ansible/ansible-language-server/tree/main/docs/changelog-frag
now don't strictly follow the release notes format suggested by [Keep a
Changelog][keepachangelog] -- by {user}`webknjaz`

[keepachangelog]: https://keepachangelog.com/en/1.1.0/ '{issue}`164`'
[keepachangelog]: https://keepachangelog.com/en/1.1.0/ "{issue}`164`"

- Replaced all the credits in the changelog with a dedicated Sphinx role -- by
{user}`webknjaz`
Expand All @@ -76,13 +76,13 @@ https://github.com/ansible/ansible-language-server/tree/main/docs/changelog-frag

[towncrier]:
https://github.com/twisted/towncrier
'{issue}`158`, {issue}`198`, {issue}`201`, {issue}`202`,
{issue}`204`, {issue}`208`, {issue}`210`'
"{issue}`158`, {issue}`198`, {issue}`201`, {issue}`202`,
{issue}`204`, {issue}`208`, {issue}`210`"

- Added [Sphinx][sphinx] documentation generator and set up the CI
infrastructure for it -- by {user}`webknjaz`

[sphinx]: https://github.com/twisted/towncrier '{issue}`161`'
[sphinx]: https://github.com/twisted/towncrier "{issue}`161`"

- Added docs and references to the Community Code Of Conduct, security and
contributing guides, and a pull request template -- by {user}`webknjaz`
Expand Down
2 changes: 1 addition & 1 deletion bin/ansible-language-server
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env node

require('../out/server/src/server.js');
require("../out/server/src/server.js");
6 changes: 3 additions & 3 deletions bin/version-bump-allowed
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
#!/usr/bin/env node

console.debug('Checking if it is allowed to bump the package version...');
console.debug("Checking if it is allowed to bump the package version...");
console.debug(
`The previous package version was ${process.env.npm_package_version}`
);

const isGitHubActionsCiCd =
process.env.CI === 'true' && process.env.GITHUB_ACTIONS === 'true';
process.env.CI === "true" && process.env.GITHUB_ACTIONS === "true";

console.debug(
`The package bump is ${
isGitHubActionsCiCd ? '' : 'not '
isGitHubActionsCiCd ? "" : "not "
}running under GitHub Actions CI/CD`
);

Expand Down
32 changes: 16 additions & 16 deletions scripts/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
parser: "@typescript-eslint/parser",
env: {
node: true,
es6: true,
},
parserOptions: {
sourceType: 'module',
sourceType: "module",
},
plugins: ['@typescript-eslint', 'prettier'],
plugins: ["@typescript-eslint", "prettier"],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'prettier',
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"prettier",
],
rules: {
'prettier/prettier': 'error',
'@typescript-eslint/no-use-before-define': [
'error',
"prettier/prettier": "error",
"@typescript-eslint/no-use-before-define": [
"error",
{ functions: false, classes: false },
],
'@typescript-eslint/no-unused-vars': ['warn'],
'@typescript-eslint/explicit-function-return-type': [
"@typescript-eslint/no-unused-vars": ["warn"],
"@typescript-eslint/explicit-function-return-type": [
1,
{ allowExpressions: true },
],
'eol-last': ['error'],
'space-infix-ops': ['error', { int32Hint: false }],
'no-multi-spaces': ['error', { ignoreEOLComments: true }],
'keyword-spacing': ['error'],
"eol-last": ["error"],
"space-infix-ops": ["error", { int32Hint: false }],
"no-multi-spaces": ["error", { ignoreEOLComments: true }],
"keyword-spacing": ["error"],
},
};
6 changes: 3 additions & 3 deletions scripts/check-dependencies.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@

/* eslint-disable @typescript-eslint/no-var-requires */

const exit = require('process').exit;
const dependencies = require('../package.json').dependencies;
const exit = require("process").exit;
const dependencies = require("../package.json").dependencies;

for (const dep in dependencies) {
if (Object.prototype.hasOwnProperty.call(dependencies, dep)) {
const version = dependencies[dep];
if (version === 'next') {
if (version === "next") {
console.error(
`Dependency ${dep} has "${version}" version, please change it to fixed version`
);
Expand Down
54 changes: 27 additions & 27 deletions src/ansibleLanguageService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,22 @@ import {
InitializeResult,
TextDocuments,
TextDocumentSyncKind,
} from 'vscode-languageserver';
import { TextDocument } from 'vscode-languageserver-textdocument';
} from "vscode-languageserver";
import { TextDocument } from "vscode-languageserver-textdocument";
import {
doCompletion,
doCompletionResolve,
} from './providers/completionProvider';
import { getDefinition } from './providers/definitionProvider';
import { doHover } from './providers/hoverProvider';
} from "./providers/completionProvider";
import { getDefinition } from "./providers/definitionProvider";
import { doHover } from "./providers/hoverProvider";
import {
doSemanticTokens,
tokenModifiers,
tokenTypes,
} from './providers/semanticTokenProvider';
import { doValidate } from './providers/validationProvider';
import { ValidationManager } from './services/validationManager';
import { WorkspaceManager } from './services/workspaceManager';
} from "./providers/semanticTokenProvider";
import { doValidate } from "./providers/validationProvider";
import { ValidationManager } from "./services/validationManager";
import { WorkspaceManager } from "./services/workspaceManager";

/**
* Initializes the connection and registers all lifecycle event handlers.
Expand Down Expand Up @@ -61,7 +61,7 @@ export class AnsibleLanguageService {
semanticTokensProvider: {
documentSelector: [
{
language: 'ansible',
language: "ansible",
},
],
full: true,
Expand Down Expand Up @@ -97,7 +97,7 @@ export class AnsibleLanguageService {
this.connection.client.register(
DidChangeConfigurationNotification.type,
{
section: 'ansible',
section: "ansible",
}
);
}
Expand All @@ -112,15 +112,15 @@ export class AnsibleLanguageService {
watchers: [
{
// watch ansible configuration
globPattern: '**/ansible.cfg',
globPattern: "**/ansible.cfg",
},
{
// watch ansible-lint configuration
globPattern: '**/.ansible-lint',
globPattern: "**/.ansible-lint",
},
{
// watch role meta-configuration
globPattern: '**/meta/main.{yml,yaml}',
globPattern: "**/meta/main.{yml,yaml}",
},
],
});
Expand All @@ -134,7 +134,7 @@ export class AnsibleLanguageService {
context.documentSettings.handleConfigurationChanged(params)
);
} catch (error) {
this.handleError(error, 'onDidChangeConfiguration');
this.handleError(error, "onDidChangeConfiguration");
}
});

Expand All @@ -152,7 +152,7 @@ export class AnsibleLanguageService {
);
}
} catch (error) {
this.handleError(error, 'onDidOpen');
this.handleError(error, "onDidOpen");
}
});

Expand All @@ -164,7 +164,7 @@ export class AnsibleLanguageService {
context.documentSettings.handleDocumentClosed(e.document.uri);
}
} catch (error) {
this.handleError(error, 'onDidClose');
this.handleError(error, "onDidClose");
}
});

Expand All @@ -174,7 +174,7 @@ export class AnsibleLanguageService {
context.handleWatchedDocumentChange(params)
);
} catch (error) {
this.handleError(error, 'onDidChangeWatchedFiles');
this.handleError(error, "onDidChangeWatchedFiles");
}
});

Expand All @@ -192,7 +192,7 @@ export class AnsibleLanguageService {
);
}
} catch (error) {
this.handleError(error, 'onDidSave');
this.handleError(error, "onDidSave");
}
});

Expand All @@ -203,7 +203,7 @@ export class AnsibleLanguageService {
e.contentChanges
);
} catch (error) {
this.handleError(error, 'onDidChangeTextDocument');
this.handleError(error, "onDidChangeTextDocument");
}
});

Expand All @@ -217,7 +217,7 @@ export class AnsibleLanguageService {
this.connection
);
} catch (error) {
this.handleError(error, 'onDidChangeContent');
this.handleError(error, "onDidChangeContent");
}
});

Expand All @@ -233,7 +233,7 @@ export class AnsibleLanguageService {
}
}
} catch (error) {
this.handleError(error, 'onSemanticTokens');
this.handleError(error, "onSemanticTokens");
}
return {
data: [],
Expand All @@ -256,7 +256,7 @@ export class AnsibleLanguageService {
}
}
} catch (error) {
this.handleError(error, 'onHover');
this.handleError(error, "onHover");
}
return null;
});
Expand All @@ -273,7 +273,7 @@ export class AnsibleLanguageService {
}
}
} catch (error) {
this.handleError(error, 'onCompletion');
this.handleError(error, "onCompletion");
}
return null;
});
Expand All @@ -289,7 +289,7 @@ export class AnsibleLanguageService {
}
}
} catch (error) {
this.handleError(error, 'onCompletionResolve');
this.handleError(error, "onCompletionResolve");
}
return completionItem;
});
Expand All @@ -310,7 +310,7 @@ export class AnsibleLanguageService {
}
}
} catch (error) {
this.handleError(error, 'onDefinition');
this.handleError(error, "onDefinition");
}
return null;
});
Expand All @@ -319,7 +319,7 @@ export class AnsibleLanguageService {
private handleError(error: unknown, contextName: string) {
const leadMessage = `An error occurred in '${contextName}' handler: `;
if (error instanceof Error) {
const stack = error.stack ? `\n${error.stack}` : '';
const stack = error.stack ? `\n${error.stack}` : "";
this.connection.console.error(
`${leadMessage}[${error.name}] ${error.message}${stack}`
);
Expand Down
4 changes: 2 additions & 2 deletions src/interfaces/extensionSettings.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export type IContainerEngine = 'auto' | 'podman' | 'docker';
export type IContainerEngine = "auto" | "podman" | "docker";

export type IPullPolicy = 'always' | 'missing' | 'never' | 'tag';
export type IPullPolicy = "always" | "missing" | "never" | "tag";

export interface ExtensionSettings {
ansible: { path: string; useFullyQualifiedCollectionNames: boolean };
Expand Down
2 changes: 1 addition & 1 deletion src/interfaces/module.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { YAMLError } from 'yaml/util';
import { YAMLError } from "yaml/util";

export type IDescription = string | Array<unknown>;

Expand Down
2 changes: 1 addition & 1 deletion src/interfaces/pluginRouting.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export type IPluginRoutingByCollection = Map<string, IPluginRoutesByType>;

export type IPluginTypes = 'modules'; // currently only modules are supported
export type IPluginTypes = "modules"; // currently only modules are supported

export type IPluginRoutesByType = Map<IPluginTypes, IPluginRoutesByName>;

Expand Down

0 comments on commit 592c597

Please sign in to comment.