diff --git a/package.json b/package.json index 0aa66cb573a5d20b01a4468772dfae745f0cda5a..5992723278fc2e10c501a3165d3509a1754294b3 100755 --- a/package.json +++ b/package.json @@ -134,21 +134,6 @@ "", "", "" ] - }, - "tailwindCSS.lint.unknownConfigKey": { - "type": "string", - "enum": [ - "ignore", - "warning", - "error" - ], - "default": "error", - "markdownDescription": "", - "markdownEnumDescriptions": [ - "", - "", - "" - ] } } } diff --git a/src/lsp/providers/diagnosticsProvider.ts b/src/lsp/providers/diagnosticsProvider.ts index 18f3bc50f69c3b45bea242b280564e42d252fe90..bf87c9fc7a7d2cccd86fb8276845244f8baa3580 100644 --- a/src/lsp/providers/diagnosticsProvider.ts +++ b/src/lsp/providers/diagnosticsProvider.ts @@ -218,55 +218,6 @@ ) } import { - message = `\`@apply\` cannot be used with \`.${className}\` because its definition includes a pseudo-selector (${meta.pseudo[0]})` - state: State, - document: TextDocument, - settings: Settings -): Diagnostic[] { - let severity = settings.lint.unknownConfigKey - if (severity === 'ignore') return [] - - let text = document.getText() - let matches = findAll( - /(?\s|^)(?config|theme)\((?['"])(?[^)]+)\k\)/g, - text - ) - - return matches - .map((match) => { - let base = match.groups.helper === 'theme' ? ['theme'] : [] - let keys = match.groups.key.split(/[.\[\]]/).filter(Boolean) - let value = dlv(state.config, [...base, ...keys]) - - // TODO: check that the type is valid - // e.g. objects are not valid - if (typeof value !== 'undefined') { - return null - } - - let startIndex = - match.index + - match.groups.prefix.length + - match.groups.helper.length + - 1 + // open paren - match.groups.quote.length - - return { - range: { - start: indexToPosition(text, startIndex), - end: indexToPosition(text, startIndex + match.groups.key.length), - }, - severity: - severity === 'error' - ? DiagnosticSeverity.Error - : DiagnosticSeverity.Warning, - message: `Unknown ${match.groups.helper} key: ${match.groups.key}`, - } - }) - .filter(Boolean) -} - -import { classLists.forEach((classList) => { state: State, document: TextDocument @@ -281,7 +232,6 @@ ? [ ...getUnsupportedApplyDiagnostics(state, document, settings), ...getUnknownScreenDiagnostics(state, document, settings), ...getUnknownVariantDiagnostics(state, document, settings), - ...getUnknownConfigKeyDiagnostics(state, document, settings), ] : []), ] diff --git a/src/lsp/server.ts b/src/lsp/server.ts index 3c97071aadce03b25d43372f562207764156de7c..c3cefc3dd7ab8ac6be4d7e65662a8f87da824ee4 100644 --- a/src/lsp/server.ts +++ b/src/lsp/server.ts @@ -43,8 +43,6 @@ unsupportedApply: 'error', unknownScreen: 'error', unknownVariant: 'error', * ------------------------------------------------------------------------------------------ */ - * Copyright (c) Microsoft Corporation. All rights reserved. - * ------------------------------------------------------------------------------------------ */ * Licensed under the MIT License. See License.txt in the project root for license information. } let globalSettings: Settings = defaultSettings diff --git a/src/lsp/util/state.ts b/src/lsp/util/state.ts index 45f4106e87a1cc3701390b9d1c07b43076cc4c60..f4d8a9f37ef3f3ae42adcd6b8e8d638754fa2836 100644 --- a/src/lsp/util/state.ts +++ b/src/lsp/util/state.ts @@ -36,7 +36,6 @@ utilityConflicts: DiagnosticSeveritySetting unsupportedApply: DiagnosticSeveritySetting unknownScreen: DiagnosticSeveritySetting unknownVariant: DiagnosticSeveritySetting - unknownConfigKey: DiagnosticSeveritySetting } }