update lint setting names
parent
bb3605c9ad
commit
f4507eea46
10
package.json
10
package.json
|
@ -87,7 +87,7 @@
|
|||
"markdownDescription": "",
|
||||
"scope": "language-overridable"
|
||||
},
|
||||
"tailwindCSS.lint.unsupportedApply": {
|
||||
"tailwindCSS.lint.invalidApply": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"ignore",
|
||||
|
@ -98,7 +98,7 @@
|
|||
"markdownDescription": "",
|
||||
"scope": "language-overridable"
|
||||
},
|
||||
"tailwindCSS.lint.unknownScreen": {
|
||||
"tailwindCSS.lint.invalidScreen": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"ignore",
|
||||
|
@ -109,7 +109,7 @@
|
|||
"markdownDescription": "",
|
||||
"scope": "language-overridable"
|
||||
},
|
||||
"tailwindCSS.lint.unknownVariant": {
|
||||
"tailwindCSS.lint.invalidVariant": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"ignore",
|
||||
|
@ -120,7 +120,7 @@
|
|||
"markdownDescription": "",
|
||||
"scope": "language-overridable"
|
||||
},
|
||||
"tailwindCSS.lint.invalidHelperKey": {
|
||||
"tailwindCSS.lint.invalidConfigPath": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"ignore",
|
||||
|
@ -131,7 +131,7 @@
|
|||
"markdownDescription": "",
|
||||
"scope": "language-overridable"
|
||||
},
|
||||
"tailwindCSS.lint.unsupportedTailwindDirective": {
|
||||
"tailwindCSS.lint.invalidTailwindDirective": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"ignore",
|
||||
|
|
|
@ -25,12 +25,12 @@ import { isObject } from '../../class-names/isObject'
|
|||
import { stringToPath } from '../util/stringToPath'
|
||||
import { closest } from '../util/closest'
|
||||
|
||||
function getUnsupportedApplyDiagnostics(
|
||||
function getInvalidApplyDiagnostics(
|
||||
state: State,
|
||||
document: TextDocument,
|
||||
settings: Settings
|
||||
): Diagnostic[] {
|
||||
let severity = settings.lint.unsupportedApply
|
||||
let severity = settings.lint.invalidApply
|
||||
if (severity === 'ignore') return []
|
||||
|
||||
const classNames = findClassNamesInRange(document, undefined, 'css')
|
||||
|
@ -138,12 +138,12 @@ function getUtilityConflictDiagnostics(
|
|||
return diagnostics
|
||||
}
|
||||
|
||||
function getUnknownScreenDiagnostics(
|
||||
function getInvalidScreenDiagnostics(
|
||||
state: State,
|
||||
document: TextDocument,
|
||||
settings: Settings
|
||||
): Diagnostic[] {
|
||||
let severity = settings.lint.unknownScreen
|
||||
let severity = settings.lint.invalidScreen
|
||||
if (severity === 'ignore') return []
|
||||
|
||||
let diagnostics: Diagnostic[] = []
|
||||
|
@ -199,12 +199,12 @@ function getUnknownScreenDiagnostics(
|
|||
return diagnostics
|
||||
}
|
||||
|
||||
function getUnknownVariantDiagnostics(
|
||||
function getInvalidVariantDiagnostics(
|
||||
state: State,
|
||||
document: TextDocument,
|
||||
settings: Settings
|
||||
): Diagnostic[] {
|
||||
let severity = settings.lint.unknownVariant
|
||||
let severity = settings.lint.invalidVariant
|
||||
if (severity === 'ignore') return []
|
||||
|
||||
let diagnostics: Diagnostic[] = []
|
||||
|
@ -263,12 +263,12 @@ function getUnknownVariantDiagnostics(
|
|||
return diagnostics
|
||||
}
|
||||
|
||||
function getInvalidHelperKeyDiagnostics(
|
||||
function getInvalidConfigPathDiagnostics(
|
||||
state: State,
|
||||
document: TextDocument,
|
||||
settings: Settings
|
||||
): Diagnostic[] {
|
||||
let severity = settings.lint.invalidHelperKey
|
||||
let severity = settings.lint.invalidConfigPath
|
||||
if (severity === 'ignore') return []
|
||||
|
||||
let diagnostics: Diagnostic[] = []
|
||||
|
@ -396,12 +396,12 @@ function getInvalidHelperKeyDiagnostics(
|
|||
return diagnostics
|
||||
}
|
||||
|
||||
function getUnsupportedTailwindDirectiveDiagnostics(
|
||||
function getInvalidTailwindDirectiveDiagnostics(
|
||||
state: State,
|
||||
document: TextDocument,
|
||||
settings: Settings
|
||||
): Diagnostic[] {
|
||||
let severity = settings.lint.unsupportedTailwindDirective
|
||||
let severity = settings.lint.invalidTailwindDirective
|
||||
if (severity === 'ignore') return []
|
||||
|
||||
let diagnostics: Diagnostic[] = []
|
||||
|
@ -473,15 +473,11 @@ export async function provideDiagnostics(
|
|||
const diagnostics: Diagnostic[] = settings.validate
|
||||
? [
|
||||
...getUtilityConflictDiagnostics(state, document, settings),
|
||||
...getUnsupportedApplyDiagnostics(state, document, settings),
|
||||
...getUnknownScreenDiagnostics(state, document, settings),
|
||||
...getUnknownVariantDiagnostics(state, document, settings),
|
||||
...getInvalidHelperKeyDiagnostics(state, document, settings),
|
||||
...getUnsupportedTailwindDirectiveDiagnostics(
|
||||
state,
|
||||
document,
|
||||
settings
|
||||
),
|
||||
...getInvalidApplyDiagnostics(state, document, settings),
|
||||
...getInvalidScreenDiagnostics(state, document, settings),
|
||||
...getInvalidVariantDiagnostics(state, document, settings),
|
||||
...getInvalidConfigPathDiagnostics(state, document, settings),
|
||||
...getInvalidTailwindDirectiveDiagnostics(state, document, settings),
|
||||
]
|
||||
: []
|
||||
|
||||
|
|
|
@ -44,11 +44,11 @@ const defaultSettings: Settings = {
|
|||
validate: true,
|
||||
lint: {
|
||||
utilityConflicts: 'warning',
|
||||
unsupportedApply: 'error',
|
||||
unknownScreen: 'error',
|
||||
unknownVariant: 'error',
|
||||
invalidHelperKey: 'error',
|
||||
unsupportedTailwindDirective: 'error',
|
||||
invalidApply: 'error',
|
||||
invalidScreen: 'error',
|
||||
invalidVariant: 'error',
|
||||
invalidConfigPath: 'error',
|
||||
invalidTailwindDirective: 'error',
|
||||
},
|
||||
}
|
||||
let globalSettings: Settings = defaultSettings
|
||||
|
|
|
@ -34,11 +34,11 @@ export type Settings = {
|
|||
validate: boolean
|
||||
lint: {
|
||||
utilityConflicts: DiagnosticSeveritySetting
|
||||
unsupportedApply: DiagnosticSeveritySetting
|
||||
unknownScreen: DiagnosticSeveritySetting
|
||||
unknownVariant: DiagnosticSeveritySetting
|
||||
invalidHelperKey: DiagnosticSeveritySetting
|
||||
unsupportedTailwindDirective: DiagnosticSeveritySetting
|
||||
invalidApply: DiagnosticSeveritySetting
|
||||
invalidScreen: DiagnosticSeveritySetting
|
||||
invalidVariant: DiagnosticSeveritySetting
|
||||
invalidConfigPath: DiagnosticSeveritySetting
|
||||
invalidTailwindDirective: DiagnosticSeveritySetting
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue