Skip to content

Commit

Permalink
chore: standardize file name capitalization (#167)
Browse files Browse the repository at this point in the history
  • Loading branch information
adhamfarrag authored Sep 21, 2024
1 parent db4b81c commit cc6099f
Show file tree
Hide file tree
Showing 68 changed files with 470 additions and 477 deletions.
22 changes: 21 additions & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import unjs from 'eslint-config-unjs';
export default unjs({
rules: {
'@typescript-eslint/naming-convention': 'off',
"@typescript-eslint/no-duplicate-enum-values": 'off',
'@typescript-eslint/no-duplicate-enum-values': 'off',
'@typescript-eslint/semi': 'off',
'curly': ['error', 'all'],
'eqeqeq': 'warn',
Expand All @@ -23,6 +23,26 @@ export default unjs({
'prefer-const': ['error', { destructuring: 'any', ignoreReadBeforeAssign: false }],
'require-await': 'error',
'sort-imports': ['error', { ignoreDeclarationSort: true }],
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'no-template-curly-in-string': 'off',
'array-callback-return': 'off',
'camelcase': 'off',
'no-console': 'off',
'quotes': ['error', 'single'],
'comma-spacing': ['error', { before: false, after: true }],
'keyword-spacing': ['error', { before: true, after: true }],
'space-before-function-paren': ['error', 'always'],
'object-curly-spacing': ['error', 'always'],
'arrow-spacing': ['error', { before: true, after: true }],
'key-spacing': ['error', { beforeColon: false, afterColon: true, mode: 'strict' }],
'space-before-blocks': ['error', 'always'],
'space-infix-ops': ['error', { int32Hint: false }],
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/ban-types': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-extraneous-class': 'off',
'comma-dangle': 'off',
},
ignores: [
'out',
Expand Down
4 changes: 2 additions & 2 deletions knip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ const config: KnipConfig = {
ignoreDependencies: ['ofetch', '@types/vscode-webview', 'prettier', 'prettier-plugin-tailwindcss'],
ignore: ['build/**', 'prettier.config.ts'],
vite: {
"config": [
"vite.config.ts"
'config': [
'vite.config.ts'
]
}
}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions src/codelens/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { languages } from 'vscode';
import { ModulesCodelensProvider } from './modules'
import { PluginsCodelensProvider } from './plugins'
import { LayersCodeLensProvider } from './layers'
import { LayersCodeLensProvider } from './layers';
import { ModulesCodelensProvider } from './modules';
import { PluginsCodelensProvider } from './plugins';

function activateCodelenses() {
function activateCodelenses () {
const modulesLens = new ModulesCodelensProvider()
const pluginsLens = new PluginsCodelensProvider()
const layersLens = new LayersCodeLensProvider()
Expand Down
12 changes: 6 additions & 6 deletions src/codelens/layers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ export class LayersCodeLensProvider implements CodeLensProvider {
private _onDidChangeCodeLenses: EventEmitter<void> = new EventEmitter<void>()
public readonly onDidChangeCodeLenses: Event<void> = this._onDidChangeCodeLenses.event

constructor() {
constructor () {
this.regex = /extends:/g,

workspace.onDidChangeConfiguration((_) => { this._onDidChangeCodeLenses.fire() })
}

public provideCodeLenses(document: TextDocument): CodeLens[] | Thenable<CodeLens[]> {
public provideCodeLenses (document: TextDocument): CodeLens[] | Thenable<CodeLens[]> {

this.codeLenses = []
const regex = new RegExp(this.regex)
Expand All @@ -31,13 +31,13 @@ export class LayersCodeLensProvider implements CodeLensProvider {
return this.codeLenses
}

public resolveCodeLens(codeLens: CodeLens) {
if (workspace.getConfiguration("codelens-sample").get("enableCodeLens", true)) {
public resolveCodeLens (codeLens: CodeLens) {
if (workspace.getConfiguration('codelens-sample').get('enableCodeLens', true)) {
codeLens.command = {
title: 'Add new layer',
tooltip: "Nuxtr: Add new layer",
tooltip: 'Nuxtr: Add new layer',
command: 'nuxtr.createLayer',
arguments: ["Argument 1", false]
arguments: ['Argument 1', false]
}
return codeLens
}
Expand Down
22 changes: 7 additions & 15 deletions src/codelens/modules.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
import {
CodeLens,
CodeLensProvider,
Event,
EventEmitter,
Position,
TextDocument,
workspace,
} from 'vscode';
import { CodeLens, CodeLensProvider, Event, EventEmitter, Position, TextDocument, workspace } from 'vscode';

export class ModulesCodelensProvider implements CodeLensProvider {

Expand All @@ -15,15 +7,15 @@ export class ModulesCodelensProvider implements CodeLensProvider {
private _onDidChangeCodeLenses: EventEmitter<void> = new EventEmitter<void>()
public readonly onDidChangeCodeLenses: Event<void> = this._onDidChangeCodeLenses.event

constructor() {
constructor () {
this.regex = /modules:/g

workspace.onDidChangeConfiguration((_) => {
this._onDidChangeCodeLenses.fire()
})
}

public provideCodeLenses(document: TextDocument): CodeLens[] | Thenable<CodeLens[]> {
public provideCodeLenses (document: TextDocument): CodeLens[] | Thenable<CodeLens[]> {

this.codeLenses = []
const regex = new RegExp(this.regex)
Expand All @@ -41,13 +33,13 @@ export class ModulesCodelensProvider implements CodeLensProvider {
return this.codeLenses
}

public resolveCodeLens(codeLens: CodeLens) {
if (workspace.getConfiguration("codelens-sample").get("enableCodeLens", true)) {
public resolveCodeLens (codeLens: CodeLens) {
if (workspace.getConfiguration('codelens-sample').get('enableCodeLens', true)) {
codeLens.command = {
title: 'Add new module',
tooltip: "Tooltip provided by sample extension",
tooltip: 'Tooltip provided by sample extension',
command: 'nuxtr.createModuleAction',
arguments: ["Argument 1", false]
arguments: ['Argument 1', false]
}
return codeLens
}
Expand Down
14 changes: 7 additions & 7 deletions src/codelens/plugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ export class PluginsCodelensProvider implements CodeLensProvider {
private _onDidChangeCodeLenses: EventEmitter<void> = new EventEmitter<void>()
public readonly onDidChangeCodeLenses: Event<void> = this._onDidChangeCodeLenses.event

constructor() {
constructor () {
this.regex = /plugins:/g

workspace.onDidChangeConfiguration((_) => {
this._onDidChangeCodeLenses.fire()
})
}

public provideCodeLenses(document: TextDocument): CodeLens[] | Thenable<CodeLens[]> {
public provideCodeLenses (document: TextDocument): CodeLens[] | Thenable<CodeLens[]> {

if (workspace.getConfiguration("codelens-sample").get("enableCodeLens", true)) {
if (workspace.getConfiguration('codelens-sample').get('enableCodeLens', true)) {
this.codeLenses = []
const regex = new RegExp(this.regex)
const text = document.getText()
Expand All @@ -36,13 +36,13 @@ export class PluginsCodelensProvider implements CodeLensProvider {
return []
}

public resolveCodeLens(codeLens: CodeLens) {
if (workspace.getConfiguration("codelens-sample").get("enableCodeLens", true)) {
public resolveCodeLens (codeLens: CodeLens) {
if (workspace.getConfiguration('codelens-sample').get('enableCodeLens', true)) {
codeLens.command = {
title: 'Add new plugin',
command: 'nuxtr.createPlugin',
tooltip: "Tooltip provided by sample extension",
arguments: ["Argument 1", false]
tooltip: 'Tooltip provided by sample extension',
arguments: ['Argument 1', false]
}
return codeLens
}
Expand Down
8 changes: 4 additions & 4 deletions src/commands/CSS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ enum VuetifyOptions {
createConfigFile = 'Create Vuetify config file',
}

function configureCSS() {
function configureCSS () {
window
.showQuickPick(frameworks, {
canPickMany: false,
Expand Down Expand Up @@ -85,7 +85,7 @@ const configureTailwind = () => {
const filePath = `${await projectSrcDirectory()}/assets/css/tailwind.css`

await createFile({
fileName: `tailwind.css`,
fileName: 'tailwind.css',
content: tailwindCSSFile,
fullPath: filePath,
})
Expand Down Expand Up @@ -144,7 +144,7 @@ const configureUno = async () => {

if (selections.includes(UnoCSSOptions.createConfigFile)) {
await createFile({
fileName: `uno.config.ts`,
fileName: 'uno.config.ts',
content: unoCSSConfig,
fullPath: filePath,
})
Expand Down Expand Up @@ -192,7 +192,7 @@ const configureVuetify = async () => {

if (selections.includes(VuetifyOptions.createConfigFile)) {
await createFile({
fileName: `vuetify.config.ts`,
fileName: 'vuetify.config.ts',
content: vuetifyConfigFile,
fullPath: filePath,
})
Expand Down
4 changes: 2 additions & 2 deletions src/commands/Component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { window } from 'vscode'
import { window } from 'vscode';
import { createDir, createFile, createSubFolders, generateVueFileBasicTemplate, projectSrcDirectory, showSubFolderQuickPick, } from '../utils';

const createComponent = () => {
Expand Down Expand Up @@ -44,4 +44,4 @@ const directCreateComponent = (path: string) => {
})
}

export { createComponent, directCreateComponent }
export { createComponent, directCreateComponent };
4 changes: 2 additions & 2 deletions src/commands/Composable.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { window } from 'vscode'
import { createDir, createFile, createSubFolders, normalizeFileExtension, projectSrcDirectory, showSubFolderQuickPick } from '../utils'
import { composableTemplate } from '../templates'
import { createDir, createFile, createSubFolders, normalizeFileExtension, projectSrcDirectory, showSubFolderQuickPick } from '../utils'

const createComposable = () => {
window
.showInputBox({
prompt: 'What is your composable name?',
placeHolder: 'composable name',
})
.then(async(name) => {
.then(async (name) => {

if (!name) { return }

Expand Down
Loading

0 comments on commit cc6099f

Please sign in to comment.