Skip to content

Error when files.excludes pattern contains braces #695

@NazmusSayad

Description

@NazmusSayad

What version of Tailwind CSS IntelliSense are you using?

v0.9.4

What version of Tailwind CSS are you using?

v3.2.4

What package manager are you using?

I have tried this with both npm and yarn.

What operating system are you using?

Debian, Linux

Tailwind config

const colors = [
  '#131517',
  '#1E1F25',
  '#282932',
  '#606389',
  '#296EFF',
  '#94b7ff',
  '#cadbff',
  '#e2ebff',
  '#f9fbff',
]

const lightColorsObj = Object.fromEntries(
  colors.map((color, ind) => [10 - (ind + 1), color])
)
const darkColorsObj = Object.fromEntries(
  colors.map((color, ind) => [ind + 1, color])
)

const themeSwapper = require('tailwindcss-theme-swapper')({
  themes: [
    {
      name: 'base',
      selectors: [':root'],
      theme: {
        colors: { clr: lightColorsObj },
      },
    },
    {
      name: 'dark',
      selectors: ['.dark'],
      theme: {
        colors: { clr: darkColorsObj },
      },
    },
  ],
})

/** @type {import('tailwindcss').Config} */
module.exports = {
  content: {
    files: ['./src/**/*.{jsx,tsx}'],
    transform: require('tailwind-variant-group').default,
  },
  theme: {
    fontFamily: {
      roboto: ['Roboto', 'sans-serif'],
      dm: ['DM Sans', 'sans-serif'],
    },
    screens: {
      xxs: '25em',
      xs: '31.25em',
      sm: '37.5em',
      md: '48em',
      lg: '62em',
      xl: '75em',
      xxl: '120em',
    },
  },
  plugins: [themeSwapper],
  corePlugins: {
    preflight: false,
  },
}

VS Code settings

{
  "editor.fontFamily": "Fira Code",
  "workbench.colorTheme": "OnnoKicu",
  "editor.lineHeight": 1.6,
  "terminal.integrated.lineHeight": 1.25,
  "editor.fontLigatures": "'zero','ss02','ss03','ss04','ss05'",
  "window.title": "${activeEditorMedium} ╭• ${folderName} •╮ ﷽",
  "update.mode": "none",
  "update.enableWindowsBackgroundUpdates": false,
  "update.showReleaseNotes": false,
  "extensions.autoCheckUpdates": false,
  "extensions.autoUpdate": false,
  "extensions.ignoreRecommendations": true,
  "telemetry.telemetryLevel": "off",
  "workbench.editor.tabCloseButton": "off",
  "workbench.editor.untitled.hint": "hidden",
  "workbench.editor.languageDetection": false,
  "workbench.enableExperiments": false,
  "workbench.startupEditor": "none",
  "workbench.tips.enabled": false,
  "workbench.tree.renderIndentGuides": "none",
  "workbench.commandPalette.history": 0,
  "workbench.settings.enableNaturalLanguageSearch": false,
  "workbench.editor.decorations.colors": false,
  "workbench.localHistory.enabled": false,
  "workbench.editor.historyBasedLanguageDetection": false,
  "workbench.sideBar.location": "right",
  "workbench.layoutControl.enabled": false,
  "window.restoreWindows": "one",
  "window.enableMenuBarMnemonics": false,
  "window.menuBarVisibility": "toggle",
  "window.openFoldersInNewWindow": "off",
  "window.openWithoutArgumentsInNewWindow": "off",
  "window.autoDetectHighContrast": false,
  "window.restoreFullscreen": true,
  "workbench.panel.defaultLocation": "left",
  "git.enabled": false,
  "npm.autoDetect": "off",
  "files.autoSave": "onWindowChange",
  "files.exclude": {
    "**/{package-lock.json,pnpm-lock.yaml,yarn.lock,node_modules,.gitignore,.npmignore,.vscode,.codespaces,.oryx}/**": true
  },
  "search.exclude": {
    "**/{package-lock.json,pnpm-lock.yaml,yarn.lock,.gitignore,.npmignore,.git,.vscode,.codespaces,.oryx}": true
  },
  "path-autocomplete.ignoredPrefixes": ["//"],
  "path-autocomplete.extensionOnImport": true,
  "path-autocomplete.excludedItems": {
    "**": {
      "when": "**/*.{html,css,sass,scss}"
    },
    "**/{package-lock.json,pnpm-lock.yaml,yarn.lock,node_modules,.gitignore,.npmignore,.vscode,.codespaces,.oryx}/**": {
      "when": "**"
    }
  },
  "path-autocomplete.transformations": [
    {
      "type": "replace",
      "parameters": ["\\.(js|jsx|ts|tsx)$", ""]
    }
  ],
  "typescript.suggest.paths": false,
  "javascript.suggest.paths": false,
  "terminal.external.windowsExec": "powershell",
  "terminal.integrated.enableMultiLinePasteWarning": false,
  "terminal.integrated.cursorBlinking": true,
  "terminal.integrated.cursorStyle": "line",
  "files.participants.timeout": 0,
  "files.saveConflictResolution": "overwriteFileOnDisk",
  "explorer.confirmDragAndDrop": false,
  "explorer.confirmDelete": false,
  "explorer.compactFolders": false,
  "problems.showCurrentInStatus": true,
  "problems.decorations.enabled": false,
  "breadcrumbs.enabled": false,
  "editor.foldingHighlight": false,
  "editor.copyWithSyntaxHighlighting": false,
  "editor.padding.bottom": 48,
  "editor.semanticHighlighting.enabled": false,
  "editor.accessibilitySupport": "off",
  "editor.codeLens": false,
  "editor.guides.bracketPairsHorizontal": false,
  "editor.guides.bracketPairs": true,
  "editor.dragAndDrop": false,
  "editor.glyphMargin": false,
  "editor.lightbulb.enabled": false,
  "editor.useTabStops": false,
  "editor.selectionHighlight": false,
  "editor.roundedSelection": false,
  "editor.emptySelectionClipboard": false,
  "editor.smartSelect.selectLeadingAndTrailingWhitespace": false,
  "editor.trimAutoWhitespace": false,
  "editor.renderWhitespace": "none",
  "editor.scrollbar.verticalScrollbarSize": 10,
  "editor.scrollbar.horizontal": "hidden",
  "editor.multiCursorModifier": "ctrlCmd",
  "editor.quickSuggestions": {
    "other": true,
    "strings": true,
    "comments": true
  },
  "editor.wordBasedSuggestions": false,
  "editor.acceptSuggestionOnCommitCharacter": false,
  "editor.inlineSuggest.enabled": false,
  "editor.acceptSuggestionOnEnter": "off",
  "editor.suggestSelection": "first",
  "editor.minimap.enabled": false,
  "editor.suggest.insertMode": "replace",
  "[javascript][javascriptreact][typescript][typescriptreact]": {
    "editor.snippetSuggestions": "top"
  },
  "javascript.suggest.completeFunctionCalls": true,
  "typescript.suggest.completeFunctionCalls": true,
  "editor.suggest.snippetsPreventQuickSuggestions": false,
  "editor.parameterHints.enabled": false,
  "editor.hover.above": false,
  "editor.detectIndentation": false,
  "editor.scrollBeyondLastLine": false,
  "editor.smoothScrolling": true,
  "editor.find.cursorMoveOnType": false,
  "editor.cursorBlinking": "expand",
  "editor.defaultFormatter": "esbenp.prettier-vscode",
  "editor.showDeprecated": false,
  "editor.wordWrap": "on",
  "editor.tabSize": 2,
  "prettier.tabWidth": 2,
  "prettier.semi": false,
  "prettier.singleQuote": true,
  "search.quickOpen.includeHistory": false,
  "typescript.preferences.autoImportFileExcludePatterns": [
    "react-icons",
    "typescript"
  ],
  "javascript.preferences.autoImportFileExcludePatterns": [
    "react-icons",
    "typescript"
  ],
  "javascript.updateImportsOnFileMove.enabled": "always",
  "typescript.updateImportsOnFileMove.enabled": "always",
  "typescript.suggestionActions.enabled": false,
  "javascript.suggestionActions.enabled": false,
  "javascript.preferences.jsxAttributeCompletionStyle": "braces",
  "typescript.preferences.jsxAttributeCompletionStyle": "braces",
  "typescript.surveys.enabled": false,
  "html.hover.references": false,
  "html.hover.documentation": false,
  "scss.lint.emptyRules": "ignore",
  "css.hover.references": false,
  "scss.hover.references": false,
  "css.hover.documentation": false,
  "scss.hover.documentation": false,
  "css.lint.duplicateProperties": "warning",
  "scss.lint.duplicateProperties": "warning",
  "html.format.enable": false,
  "json.format.enable": false,
  "typescript.format.enable": false,
  "javascript.format.enable": false,
  "css.format.enable": false,
  "less.format.enable": false,
  "scss.format.enable": false,
  "task.autoDetect": "off",
  "githubIssues.issueCompletions.enabled": false,
  "githubIssues.userCompletions.enabled": false,
  "search.searchOnType": false,
  "security.workspace.trust.enabled": false,
  "npm.fetchOnlinePackageInfo": false,
  "npm.scriptHover": false,
  "typescript.tsc.autoDetect": "off",
  "debug.internalConsoleOptions": "neverOpen",
  "simpleBrowser.focusLockIndicator.enabled": false,
  "tailwindCSS.emmetCompletions": true,
  "tailwindCSS.includeLanguages": {
    "css": "css",
    "html": "html",
    "javascript": "javascript"
  }
}

Reproduction URL

https://github.com/NazmusSayad/react-ts/tree/tailwind-issue

Describe your issue

I don't know how to explain this. Sometime it works perfectly but sometime not . I have reinstalled the extension many time also reloaded vscode many times. Still the same issue. But when I delete custom config and exec "npx tailwindcss init -p", most of the times it is working.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions