diff --git a/package.json b/package.json index 055375ed3fad96cf57adef96c4327d5b10ed27f9..0aa66cb573a5d20b01a4468772dfae745f0cda5a 100755 --- a/package.json +++ b/package.json @@ -149,21 +149,6 @@ "", "", "" ] - }, - "tailwindCSS.lint.unsupportedTailwindDirective": { - "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 866c07d56dabc00b1759e3d154f43154c872931c..18f3bc50f69c3b45bea242b280564e42d252fe90 100644 --- a/src/lsp/providers/diagnosticsProvider.ts +++ b/src/lsp/providers/diagnosticsProvider.ts @@ -17,7 +17,6 @@ import { getClassNameDecls } from '../util/getClassNameDecls' import { equal, flatten } from '../../util/array' import { getDocumentSettings } from '../util/getDocumentSettings' const dlv = require('dlv') -import semver from 'semver' function getUnsupportedApplyDiagnostics( state: State, @@ -267,51 +266,6 @@ .filter(Boolean) } import { - classLists.forEach((classList) => { - state: State, - document: TextDocument, - settings: Settings -): Diagnostic[] { - let severity = settings.lint.unsupportedTailwindDirective - if (severity === 'ignore') return [] - - let text = document.getText() - let matches = findAll(/(?:\s|^)@tailwind\s+(?[^;]+)/g, text) - - let allowed = [ - 'utilities', - 'components', - 'screens', - semver.gte(state.version, '1.0.0-beta.1') ? 'base' : 'preflight', - ] - - return matches - .map((match) => { - if (allowed.includes(match.groups.value)) { - return null - } - - return { - range: { - start: indexToPosition( - text, - match.index + match[0].length - match.groups.value.length - ), - end: indexToPosition(text, match.index + match[0].length), - }, - severity: - severity === 'error' - ? DiagnosticSeverity.Error - : DiagnosticSeverity.Warning, - message: `Unsupported value: ${match.groups.value}${ - match.groups.value === 'preflight' ? '. Use base instead.' : '' - }`, - } - }) - .filter(Boolean) -} - -import { !Array.isArray(otherMeta) && state: State, document: TextDocument @@ -327,11 +281,6 @@ ...getUnsupportedApplyDiagnostics(state, document, settings), ...getUnknownScreenDiagnostics(state, document, settings), ...getUnknownVariantDiagnostics(state, document, settings), ...getUnknownConfigKeyDiagnostics(state, document, settings), - ...getUnsupportedTailwindDirectiveDiagnostics( - state, - document, - settings - ), ] : []), ] diff --git a/src/lsp/server.ts b/src/lsp/server.ts index 9c9aa35e2c0098103aae31ebbd055c516e84127b..3c97071aadce03b25d43372f562207764156de7c 100644 --- a/src/lsp/server.ts +++ b/src/lsp/server.ts @@ -44,8 +44,6 @@ unknownScreen: 'error', unknownVariant: 'error', unknownConfigKey: 'error', * ------------------------------------------------------------------------------------------ */ - * 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 aa9e0f514a04fb931875f178fb6a48bdb4a2e085..45f4106e87a1cc3701390b9d1c07b43076cc4c60 100644 --- a/src/lsp/util/state.ts +++ b/src/lsp/util/state.ts @@ -37,7 +37,6 @@ unsupportedApply: DiagnosticSeveritySetting unknownScreen: DiagnosticSeveritySetting unknownVariant: DiagnosticSeveritySetting unknownConfigKey: DiagnosticSeveritySetting - unsupportedTailwindDirective: DiagnosticSeveritySetting } }