├── .github
└── workflows
│ ├── autofix.yml
│ └── update.yml
├── .gitignore
├── .vscode
├── launch.json
├── settings.json
└── tasks.json
├── LICENSE
├── README.md
├── eslint.config.js
├── extension
├── .vscodeignore
├── LICENSE
├── README.md
├── package.json
├── res
│ ├── logo.png
│ └── logo.svg
└── src
│ ├── config.ts
│ ├── constants.ts
│ ├── fetch.ts
│ └── index.ts
├── package.json
├── pnpm-lock.yaml
├── pnpm-workspace.yaml
└── update.mjs
/.github/workflows/autofix.yml:
--------------------------------------------------------------------------------
1 | name: autofix.ci
2 |
3 | on:
4 | push:
5 | branches:
6 | - main
7 | pull_request:
8 | branches:
9 | - main
10 | permissions:
11 | contents: read
12 |
13 | jobs:
14 | autofix:
15 | runs-on: ubuntu-latest
16 | timeout-minutes: 10
17 |
18 | steps:
19 | - uses: actions/checkout@v4
20 | - uses: pnpm/action-setup@v4
21 | - uses: actions/setup-node@v4
22 | with:
23 | node-version: lts/*
24 |
25 | - name: Setup
26 | run: npm i -g @antfu/ni
27 |
28 | - name: Install
29 | run: nci
30 |
31 | - name: Lint
32 | run: nr lint --fix
33 |
34 | - uses: autofix-ci/action@dd55f44df8f7cdb7a6bf74c78677eb8acd40cd0a
35 |
--------------------------------------------------------------------------------
/.github/workflows/update.yml:
--------------------------------------------------------------------------------
1 | on:
2 | push:
3 | branches:
4 | - main
5 | paths:
6 | - update.mjs
7 |
8 | jobs:
9 | update:
10 | runs-on: ubuntu-latest
11 | steps:
12 | - uses: actions/checkout@v4
13 | - uses: pnpm/action-setup@v4
14 | - uses: actions/setup-node@v4
15 | with:
16 | node-version: lts/*
17 | - run: npm run update
18 | - uses: stefanzweifel/git-auto-commit-action@v4
19 | with:
20 | commit_message: 'chore: update'
21 | file_pattern: README.md
22 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | yarn.lock
3 | package-lock.json
4 | dist
5 | .DS_Store
6 | *.log
7 | *.vsix
8 | .idea
9 |
--------------------------------------------------------------------------------
/.vscode/launch.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": "0.2.0",
3 | "configurations": [
4 | {
5 | "name": "Extension",
6 | "type": "extensionHost",
7 | "request": "launch",
8 | "runtimeExecutable": "${execPath}",
9 | "args": [
10 | "--extensionDevelopmentPath=${workspaceFolder}/extension"
11 | ],
12 | "outFiles": [
13 | "${workspaceFolder}/extension/dist/**/*.js"
14 | ],
15 | "preLaunchTask": "npm: ext:dev"
16 | }
17 | ]
18 | }
19 |
--------------------------------------------------------------------------------
/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | // Enable the ESlint flat config support
3 | "eslint.experimental.useFlatConfig": true,
4 |
5 | // Disable the default formatter, use eslint instead
6 | "prettier.enable": false,
7 | "editor.formatOnSave": false,
8 |
9 | // Auto fix
10 | "editor.codeActionsOnSave": {
11 | "source.fixAll": "explicit",
12 | "source.organizeImports": "never"
13 | },
14 |
15 | // Silent the stylistic rules in you IDE, but still auto fix them
16 | "eslint.rules.customizations": [
17 | { "rule": "style/*", "severity": "off" },
18 | { "rule": "*-indent", "severity": "off" },
19 | { "rule": "*-spacing", "severity": "off" },
20 | { "rule": "*-spaces", "severity": "off" },
21 | { "rule": "*-order", "severity": "off" },
22 | { "rule": "*-dangle", "severity": "off" },
23 | { "rule": "*-newline", "severity": "off" },
24 | { "rule": "*quotes", "severity": "off" },
25 | { "rule": "*semi", "severity": "off" }
26 | ],
27 |
28 | // Enable eslint for all supported languages
29 | "eslint.validate": [
30 | "javascript",
31 | "javascriptreact",
32 | "typescript",
33 | "typescriptreact",
34 | "vue",
35 | "html",
36 | "markdown",
37 | "json",
38 | "jsonc",
39 | "yaml"
40 | ]
41 | }
42 |
--------------------------------------------------------------------------------
/.vscode/tasks.json:
--------------------------------------------------------------------------------
1 | // See https://go.microsoft.com/fwlink/?LinkId=733558
2 | // for the documentation about the tasks.json format
3 | {
4 | "version": "2.0.0",
5 | "tasks": [
6 | {
7 | "type": "npm",
8 | "script": "ext:dev",
9 | "isBackground": true,
10 | "presentation": {
11 | "reveal": "never"
12 | },
13 | "problemMatcher": [
14 | {
15 | "base": "$ts-webpack-watch",
16 | "background": {
17 | "activeOnStart": true,
18 | "beginsPattern": "Build start",
19 | "endsPattern": "Build complete"
20 | }
21 | }
22 | ],
23 | "group": "build"
24 | }
25 | ]
26 | }
27 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2022-Present Anthony Fu
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | Anthony's
2 |
File Nesting Config for VS Code
3 |
4 | 
5 |
6 | > Requires VS Code v1.67
7 |
8 | This is a config snippet making your file tree cleaner with the [file nesting feature](https://code.visualstudio.com/updates/v1_67#_explorer-file-nesting) of VS Code.
9 |
10 | Inspired by [this tweet](https://twitter.com/dzhavatushev/status/1500511236634599430) by [Dzhavat Ushev](https://twitter.com/dzhavatushev) and [this tweet](https://twitter.com/jachands/status/1500173829733240844) by [Jacob Hands](https://twitter.com/jachands).
11 |
12 | With some scripts to avoid duplication of works. And it's very opinionated.
13 |
14 | ## Use it
15 |
16 | ### VS Code Extension
17 |
18 | We now have a new VS Code extension to handle the updates automatically for you.
19 |
20 | [Check the readme for instructions](https://github.com/antfu/vscode-file-nesting-config/tree/main/extension).
21 |
22 | ### Update Manually
23 |
24 | Open your VS Code, bring up your `settings.json`, copy-n-paste the snippet below, and you are good to go :)
25 |
26 |
27 |
28 | ```jsonc
29 | // updated 2025-06-04 06:14
30 | // https://github.com/antfu/vscode-file-nesting-config
31 | "explorer.fileNesting.enabled": true,
32 | "explorer.fileNesting.expand": false,
33 | "explorer.fileNesting.patterns": {
34 | ".clang-tidy": ".clang-format, .clangd, compile_commands.json",
35 | ".env": "*.env, .env.*, .envrc, env.d.ts",
36 | ".gitignore": ".gitattributes, .gitmodules, .gitmessage, .lfsconfig, .mailmap, .git-blame*",
37 | ".project": ".classpath",
38 | "+layout.svelte": "+layout.ts,+layout.ts,+layout.js,+layout.server.ts,+layout.server.js,+layout.gql",
39 | "+page.svelte": "+page.server.ts,+page.server.js,+page.ts,+page.js,+page.gql",
40 | "ansible.cfg": "ansible.cfg, .ansible-lint, requirements.yml",
41 | "app.config.*": "*.env, .babelrc*, .codecov, .cssnanorc*, .env.*, .envrc, .htmlnanorc*, .lighthouserc.*, .mocha*, .postcssrc*, .terserrc*, api-extractor.json, ava.config.*, babel.config.*, capacitor.config.*, content.config.*, contentlayer.config.*, cssnano.config.*, cypress.*, env.d.ts, formkit.config.*, formulate.config.*, histoire.config.*, htmlnanorc.*, i18n.config.*, ionic.config.*, jasmine.*, jest.config.*, jsconfig.*, karma*, lighthouserc.*, panda.config.*, playwright.config.*, postcss.config.*, puppeteer.config.*, react-router.config.*, rspack.config.*, sst.config.*, svgo.config.*, tailwind.config.*, tsconfig.*, tsdoc.*, uno.config.*, unocss.config.*, vitest.config.*, vuetify.config.*, webpack.config.*, windi.config.*",
42 | "application.properties": "*.properties",
43 | "artisan": "*.env, .babelrc*, .codecov, .cssnanorc*, .env.*, .envrc, .htmlnanorc*, .lighthouserc.*, .mocha*, .postcssrc*, .terserrc*, api-extractor.json, ava.config.*, babel.config.*, capacitor.config.*, content.config.*, contentlayer.config.*, cssnano.config.*, cypress.*, env.d.ts, formkit.config.*, formulate.config.*, histoire.config.*, htmlnanorc.*, i18n.config.*, ionic.config.*, jasmine.*, jest.config.*, jsconfig.*, karma*, lighthouserc.*, panda.config.*, playwright.config.*, postcss.config.*, puppeteer.config.*, react-router.config.*, rspack.config.*, server.php, sst.config.*, svgo.config.*, tailwind.config.*, tsconfig.*, tsdoc.*, uno.config.*, unocss.config.*, vitest.config.*, vuetify.config.*, webpack.config.*, webpack.mix.js, windi.config.*",
44 | "astro.config.*": "*.env, .babelrc*, .codecov, .cssnanorc*, .env.*, .envrc, .htmlnanorc*, .lighthouserc.*, .mocha*, .postcssrc*, .terserrc*, api-extractor.json, ava.config.*, babel.config.*, capacitor.config.*, content.config.*, contentlayer.config.*, cssnano.config.*, cypress.*, env.d.ts, formkit.config.*, formulate.config.*, histoire.config.*, htmlnanorc.*, i18n.config.*, ionic.config.*, jasmine.*, jest.config.*, jsconfig.*, karma*, lighthouserc.*, panda.config.*, playwright.config.*, postcss.config.*, puppeteer.config.*, react-router.config.*, rspack.config.*, sst.config.*, svgo.config.*, tailwind.config.*, tsconfig.*, tsdoc.*, uno.config.*, unocss.config.*, vitest.config.*, vuetify.config.*, webpack.config.*, windi.config.*",
45 | "build-wrapper.log": "build-wrapper*.log, build-wrapper-dump*.json, build-wrapper-win*.exe, build-wrapper-linux*, build-wrapper-macosx*",
46 | "BUILD.bazel": "*.bzl, *.bazel, *.bazelrc, bazel.rc, .bazelignore, .bazelproject, .bazelversion, MODULE.bazel.lock, WORKSPACE",
47 | "Cargo.toml": ".clippy.toml, .rustfmt.toml, Cargo.Bazel.lock, Cargo.lock, clippy.toml, cross.toml, insta.yaml, rust-toolchain.toml, rustfmt.toml",
48 | "CMakeLists.txt": "*.cmake, *.cmake.in, .cmake-format.yaml, CMakePresets.json, CMakeCache.txt",
49 | "composer.json": ".php*.cache, composer.lock, phpunit.xml*, psalm*.xml",
50 | "default.nix": "shell.nix",
51 | "deno.json*": "*.env, .env.*, .envrc, api-extractor.json, deno.lock, env.d.ts, import-map.json, import_map.json, jsconfig.*, tsconfig.*, tsdoc.*",
52 | "Dockerfile": "*.dockerfile, .devcontainer.*, .dockerignore, captain-definition, compose.*, docker-compose.*, dockerfile*",
53 | "flake.nix": "flake.lock",
54 | "gatsby-config.*": "*.env, .babelrc*, .codecov, .cssnanorc*, .env.*, .envrc, .htmlnanorc*, .lighthouserc.*, .mocha*, .postcssrc*, .terserrc*, api-extractor.json, ava.config.*, babel.config.*, capacitor.config.*, content.config.*, contentlayer.config.*, cssnano.config.*, cypress.*, env.d.ts, formkit.config.*, formulate.config.*, gatsby-browser.*, gatsby-node.*, gatsby-ssr.*, gatsby-transformer.*, histoire.config.*, htmlnanorc.*, i18n.config.*, ionic.config.*, jasmine.*, jest.config.*, jsconfig.*, karma*, lighthouserc.*, panda.config.*, playwright.config.*, postcss.config.*, puppeteer.config.*, react-router.config.*, rspack.config.*, sst.config.*, svgo.config.*, tailwind.config.*, tsconfig.*, tsdoc.*, uno.config.*, unocss.config.*, vitest.config.*, vuetify.config.*, webpack.config.*, windi.config.*",
55 | "gemfile": ".ruby-version, gemfile.lock",
56 | "go.mod": ".air*, go.sum",
57 | "go.work": "go.work.sum",
58 | "hatch.toml": ".editorconfig, .flake8, .isort.cfg, .python-version, hatch.toml, requirements*.in, requirements*.pip, requirements*.txt, tox.ini",
59 | "I*.cs": "$(capture).cs",
60 | "Makefile": "*.mk",
61 | "mix.exs": ".credo.exs, .dialyzer_ignore.exs, .formatter.exs, .iex.exs, .tool-versions, mix.lock",
62 | "next.config.*": "*.env, .babelrc*, .codecov, .cssnanorc*, .env.*, .envrc, .htmlnanorc*, .lighthouserc.*, .mocha*, .postcssrc*, .terserrc*, api-extractor.json, ava.config.*, babel.config.*, capacitor.config.*, content.config.*, contentlayer.config.*, cssnano.config.*, cypress.*, env.d.ts, formkit.config.*, formulate.config.*, histoire.config.*, htmlnanorc.*, i18n.config.*, ionic.config.*, jasmine.*, jest.config.*, jsconfig.*, karma*, lighthouserc.*, next-env.d.ts, next-i18next.config.*, panda.config.*, playwright.config.*, postcss.config.*, puppeteer.config.*, react-router.config.*, rspack.config.*, sst.config.*, svgo.config.*, tailwind.config.*, tsconfig.*, tsdoc.*, uno.config.*, unocss.config.*, vitest.config.*, vuetify.config.*, webpack.config.*, windi.config.*",
63 | "nuxt.config.*": "*.env, .babelrc*, .codecov, .cssnanorc*, .env.*, .envrc, .htmlnanorc*, .lighthouserc.*, .mocha*, .nuxtignore, .nuxtrc, .postcssrc*, .terserrc*, api-extractor.json, ava.config.*, babel.config.*, capacitor.config.*, content.config.*, contentlayer.config.*, cssnano.config.*, cypress.*, env.d.ts, formkit.config.*, formulate.config.*, histoire.config.*, htmlnanorc.*, i18n.config.*, ionic.config.*, jasmine.*, jest.config.*, jsconfig.*, karma*, lighthouserc.*, panda.config.*, playwright.config.*, postcss.config.*, puppeteer.config.*, react-router.config.*, rspack.config.*, sst.config.*, svgo.config.*, tailwind.config.*, tsconfig.*, tsdoc.*, uno.config.*, unocss.config.*, vitest.config.*, vuetify.config.*, webpack.config.*, windi.config.*",
64 | "package.json": "*.code-workspace, .browserslist*, .circleci*, .commitlint*, .cspell*, .cursor*, .cz-config.js, .czrc, .dlint.json, .dprint.json*, .editorconfig, .eslint*, .firebase*, .flowconfig, .github*, .gitlab*, .gitmojirc.json, .gitpod*, .huskyrc*, .jslint*, .knip.*, .lintstagedrc*, .ls-lint.yml, .markdownlint*, .node-version, .nodemon*, .npm*, .nvmrc, .oxlintrc.json, .oxlintrc.json.bak, .pm2*, .pnp.*, .pnpm*, .prettier*, .pylintrc, .release-please*.json, .releaserc*, .ruff.toml, .sentry*, .shellcheckrc, .simple-git-hooks*, .stackblitz*, .styleci*, .stylelint*, .tazerc*, .textlint*, .tool-versions, .travis*, .versionrc*, .vscode*, .watchman*, .windsurfrules, .xo-config*, .yamllint*, .yarnrc*, Procfile, apollo.config.*, appveyor*, azure-pipelines*, biome.json*, bower.json, build.config.*, bun.lock, bun.lockb, bunfig.toml, colada.options.ts, commitlint*, crowdin*, cspell*, dangerfile*, dlint.json, dprint.json*, ec.config.*, electron-builder.*, eslint*, firebase.json, grunt*, gulp*, jenkins*, knip.*, lerna*, lint-staged*, nest-cli.*, netlify*, nixpacks*, nodemon*, npm-shrinkwrap.json, nx.*, package-lock.json, package.nls*.json, phpcs.xml, pm2.*, pnpm*, prettier*, pullapprove*, pyrightconfig.json, release-please*.json, release-tasks.sh, release.config.*, renovate*, rolldown.config.*, rollup.config.*, rspack*, ruff.toml, sentry.*.config.ts, simple-git-hooks*, sonar-project.properties, stylelint*, taze.config.*, tsdown.config.*, tslint*, tsup.config.*, turbo*, typedoc*, unlighthouse*, vercel*, vetur.config.*, webpack*, workspace.json, wrangler.*, xo.config.*, yarn*",
65 | "Pipfile": ".editorconfig, .flake8, .isort.cfg, .python-version, Pipfile, Pipfile.lock, requirements*.in, requirements*.pip, requirements*.txt, tox.ini",
66 | "pom.xml": "mvnw*",
67 | "pubspec.yaml": ".metadata, .packages, all_lint_rules.yaml, analysis_options.yaml, build.yaml, pubspec.lock, pubspec_overrides.yaml",
68 | "pyproject.toml": ".commitlint*, .cspell*, .dlint.json, .dprint.json*, .editorconfig, .eslint*, .flake8, .flowconfig, .isort.cfg, .jslint*, .lintstagedrc*, .ls-lint.yml, .markdownlint*, .oxlintrc.json, .oxlintrc.json.bak, .pdm-python, .pdm.toml, .prettier*, .pylintrc, .python-version, .ruff.toml, .shellcheckrc, .stylelint*, .textlint*, .xo-config*, .yamllint*, MANIFEST.in, Pipfile, Pipfile.lock, biome.json*, commitlint*, cspell*, dangerfile*, dlint.json, dprint.json*, eslint*, hatch.toml, lint-staged*, pdm.lock, phpcs.xml, poetry.lock, poetry.toml, prettier*, pyproject.toml, pyrightconfig.json, requirements*.in, requirements*.pip, requirements*.txt, ruff.toml, setup.cfg, setup.py, stylelint*, tox.ini, tslint*, uv.lock, uv.toml, xo.config.*",
69 | "quasar.conf.js": "*.env, .babelrc*, .codecov, .cssnanorc*, .env.*, .envrc, .htmlnanorc*, .lighthouserc.*, .mocha*, .postcssrc*, .terserrc*, api-extractor.json, ava.config.*, babel.config.*, capacitor.config.*, content.config.*, contentlayer.config.*, cssnano.config.*, cypress.*, env.d.ts, formkit.config.*, formulate.config.*, histoire.config.*, htmlnanorc.*, i18n.config.*, ionic.config.*, jasmine.*, jest.config.*, jsconfig.*, karma*, lighthouserc.*, panda.config.*, playwright.config.*, postcss.config.*, puppeteer.config.*, quasar.extensions.json, react-router.config.*, rspack.config.*, sst.config.*, svgo.config.*, tailwind.config.*, tsconfig.*, tsdoc.*, uno.config.*, unocss.config.*, vitest.config.*, vuetify.config.*, webpack.config.*, windi.config.*",
70 | "readme*": "AUTHORS, Authors, BACKERS*, Backers*, CHANGELOG*, CITATION*, CODEOWNERS, CODE_OF_CONDUCT*, CONTRIBUTING*, CONTRIBUTORS, COPYING*, CREDITS, Changelog*, Citation*, Code_Of_Conduct*, Codeowners, Contributing*, Contributors, Copying*, Credits, GOVERNANCE.MD, Governance.md, HISTORY.MD, History.md, LICENSE*, License*, MAINTAINERS, Maintainers, README-*, README_*, RELEASE_NOTES*, ROADMAP.MD, Readme-*, Readme_*, Release_Notes*, Roadmap.md, SECURITY.MD, SPONSORS*, Security.md, Sponsors*, authors, backers*, changelog*, citation*, code_of_conduct*, codeowners, contributing*, contributors, copying*, credits, governance.md, history.md, license*, maintainers, readme-*, readme_*, release_notes*, roadmap.md, security.md, sponsors*",
71 | "Readme*": "AUTHORS, Authors, BACKERS*, Backers*, CHANGELOG*, CITATION*, CODEOWNERS, CODE_OF_CONDUCT*, CONTRIBUTING*, CONTRIBUTORS, COPYING*, CREDITS, Changelog*, Citation*, Code_Of_Conduct*, Codeowners, Contributing*, Contributors, Copying*, Credits, GOVERNANCE.MD, Governance.md, HISTORY.MD, History.md, LICENSE*, License*, MAINTAINERS, Maintainers, README-*, README_*, RELEASE_NOTES*, ROADMAP.MD, Readme-*, Readme_*, Release_Notes*, Roadmap.md, SECURITY.MD, SPONSORS*, Security.md, Sponsors*, authors, backers*, changelog*, citation*, code_of_conduct*, codeowners, contributing*, contributors, copying*, credits, governance.md, history.md, license*, maintainers, readme-*, readme_*, release_notes*, roadmap.md, security.md, sponsors*",
72 | "README*": "AUTHORS, Authors, BACKERS*, Backers*, CHANGELOG*, CITATION*, CODEOWNERS, CODE_OF_CONDUCT*, CONTRIBUTING*, CONTRIBUTORS, COPYING*, CREDITS, Changelog*, Citation*, Code_Of_Conduct*, Codeowners, Contributing*, Contributors, Copying*, Credits, GOVERNANCE.MD, Governance.md, HISTORY.MD, History.md, LICENSE*, License*, MAINTAINERS, Maintainers, README-*, README_*, RELEASE_NOTES*, ROADMAP.MD, Readme-*, Readme_*, Release_Notes*, Roadmap.md, SECURITY.MD, SPONSORS*, Security.md, Sponsors*, authors, backers*, changelog*, citation*, code_of_conduct*, codeowners, contributing*, contributors, copying*, credits, governance.md, history.md, license*, maintainers, readme-*, readme_*, release_notes*, roadmap.md, security.md, sponsors*",
73 | "remix.config.*": "*.env, .babelrc*, .codecov, .cssnanorc*, .env.*, .envrc, .htmlnanorc*, .lighthouserc.*, .mocha*, .postcssrc*, .terserrc*, api-extractor.json, ava.config.*, babel.config.*, capacitor.config.*, content.config.*, contentlayer.config.*, cssnano.config.*, cypress.*, env.d.ts, formkit.config.*, formulate.config.*, histoire.config.*, htmlnanorc.*, i18n.config.*, ionic.config.*, jasmine.*, jest.config.*, jsconfig.*, karma*, lighthouserc.*, panda.config.*, playwright.config.*, postcss.config.*, puppeteer.config.*, react-router.config.*, remix.*, rspack.config.*, sst.config.*, svgo.config.*, tailwind.config.*, tsconfig.*, tsdoc.*, uno.config.*, unocss.config.*, vitest.config.*, vuetify.config.*, webpack.config.*, windi.config.*",
74 | "requirements.txt": ".editorconfig, .flake8, .isort.cfg, .python-version, requirements*.in, requirements*.pip, requirements*.txt, tox.ini",
75 | "rush.json": "*.code-workspace, .browserslist*, .circleci*, .commitlint*, .cspell*, .cursor*, .cz-config.js, .czrc, .dlint.json, .dprint.json*, .editorconfig, .eslint*, .firebase*, .flowconfig, .github*, .gitlab*, .gitmojirc.json, .gitpod*, .huskyrc*, .jslint*, .knip.*, .lintstagedrc*, .ls-lint.yml, .markdownlint*, .node-version, .nodemon*, .npm*, .nvmrc, .oxlintrc.json, .oxlintrc.json.bak, .pm2*, .pnp.*, .pnpm*, .prettier*, .pylintrc, .release-please*.json, .releaserc*, .ruff.toml, .sentry*, .shellcheckrc, .simple-git-hooks*, .stackblitz*, .styleci*, .stylelint*, .tazerc*, .textlint*, .tool-versions, .travis*, .versionrc*, .vscode*, .watchman*, .windsurfrules, .xo-config*, .yamllint*, .yarnrc*, Procfile, apollo.config.*, appveyor*, azure-pipelines*, biome.json*, bower.json, build.config.*, bun.lock, bun.lockb, bunfig.toml, colada.options.ts, commitlint*, crowdin*, cspell*, dangerfile*, dlint.json, dprint.json*, ec.config.*, electron-builder.*, eslint*, firebase.json, grunt*, gulp*, jenkins*, knip.*, lerna*, lint-staged*, nest-cli.*, netlify*, nixpacks*, nodemon*, npm-shrinkwrap.json, nx.*, package-lock.json, package.nls*.json, phpcs.xml, pm2.*, pnpm*, prettier*, pullapprove*, pyrightconfig.json, release-please*.json, release-tasks.sh, release.config.*, renovate*, rolldown.config.*, rollup.config.*, rspack*, ruff.toml, sentry.*.config.ts, simple-git-hooks*, sonar-project.properties, stylelint*, taze.config.*, tsdown.config.*, tslint*, tsup.config.*, turbo*, typedoc*, unlighthouse*, vercel*, vetur.config.*, webpack*, workspace.json, wrangler.*, xo.config.*, yarn*",
76 | "sanity.config.*": "sanity.cli.*, sanity.types.ts, schema.json",
77 | "setup.cfg": ".editorconfig, .flake8, .isort.cfg, .python-version, MANIFEST.in, requirements*.in, requirements*.pip, requirements*.txt, setup.cfg, tox.ini",
78 | "setup.py": ".editorconfig, .flake8, .isort.cfg, .python-version, MANIFEST.in, requirements*.in, requirements*.pip, requirements*.txt, setup.cfg, setup.py, tox.ini",
79 | "shims.d.ts": "*.d.ts",
80 | "svelte.config.*": "*.env, .babelrc*, .codecov, .cssnanorc*, .env.*, .envrc, .htmlnanorc*, .lighthouserc.*, .mocha*, .postcssrc*, .terserrc*, api-extractor.json, ava.config.*, babel.config.*, capacitor.config.*, content.config.*, contentlayer.config.*, cssnano.config.*, cypress.*, env.d.ts, formkit.config.*, formulate.config.*, histoire.config.*, houdini.config.*, htmlnanorc.*, i18n.config.*, ionic.config.*, jasmine.*, jest.config.*, jsconfig.*, karma*, lighthouserc.*, mdsvex.config.js, panda.config.*, playwright.config.*, postcss.config.*, puppeteer.config.*, react-router.config.*, rspack.config.*, sst.config.*, svgo.config.*, tailwind.config.*, tsconfig.*, tsdoc.*, uno.config.*, unocss.config.*, vite.config.*, vitest.config.*, vuetify.config.*, webpack.config.*, windi.config.*",
81 | "vite.config.*": "*.env, .babelrc*, .codecov, .cssnanorc*, .env.*, .envrc, .htmlnanorc*, .lighthouserc.*, .mocha*, .postcssrc*, .terserrc*, api-extractor.json, ava.config.*, babel.config.*, capacitor.config.*, content.config.*, contentlayer.config.*, cssnano.config.*, cypress.*, env.d.ts, formkit.config.*, formulate.config.*, histoire.config.*, htmlnanorc.*, i18n.config.*, ionic.config.*, jasmine.*, jest.config.*, jsconfig.*, karma*, lighthouserc.*, panda.config.*, playwright.config.*, postcss.config.*, puppeteer.config.*, react-router.config.*, rspack.config.*, sst.config.*, svgo.config.*, tailwind.config.*, tsconfig.*, tsdoc.*, uno.config.*, unocss.config.*, vitest.config.*, vuetify.config.*, webpack.config.*, windi.config.*",
82 | "vue.config.*": "*.env, .babelrc*, .codecov, .cssnanorc*, .env.*, .envrc, .htmlnanorc*, .lighthouserc.*, .mocha*, .postcssrc*, .terserrc*, api-extractor.json, ava.config.*, babel.config.*, capacitor.config.*, content.config.*, contentlayer.config.*, cssnano.config.*, cypress.*, env.d.ts, formkit.config.*, formulate.config.*, histoire.config.*, htmlnanorc.*, i18n.config.*, ionic.config.*, jasmine.*, jest.config.*, jsconfig.*, karma*, lighthouserc.*, panda.config.*, playwright.config.*, postcss.config.*, puppeteer.config.*, react-router.config.*, rspack.config.*, sst.config.*, svgo.config.*, tailwind.config.*, tsconfig.*, tsdoc.*, uno.config.*, unocss.config.*, vitest.config.*, vuetify.config.*, webpack.config.*, windi.config.*",
83 | "*.asax": "$(capture).*.cs, $(capture).*.vb",
84 | "*.ascx": "$(capture).*.cs, $(capture).*.vb",
85 | "*.ashx": "$(capture).*.cs, $(capture).*.vb",
86 | "*.aspx": "$(capture).*.cs, $(capture).*.vb",
87 | "*.axaml": "$(capture).axaml.cs",
88 | "*.bloc.dart": "$(capture).event.dart, $(capture).state.dart",
89 | "*.c": "$(capture).h",
90 | "*.cc": "$(capture).hpp, $(capture).h, $(capture).hxx, $(capture).hh",
91 | "*.cjs": "$(capture).cjs.map, $(capture).*.cjs, $(capture)_*.cjs",
92 | "*.component.ts": "$(capture).component.html, $(capture).component.spec.ts, $(capture).component.css, $(capture).component.scss, $(capture).component.sass, $(capture).component.less",
93 | "*.cpp": "$(capture).hpp, $(capture).h, $(capture).hxx, $(capture).hh",
94 | "*.cs": "$(capture).*.cs",
95 | "*.cshtml": "$(capture).cshtml.cs, $(capture).cshtml.css",
96 | "*.csproj": "*.config, *proj.user, appsettings.*, bundleconfig.json",
97 | "*.css": "$(capture).css.map, $(capture).*.css",
98 | "*.cxx": "$(capture).hpp, $(capture).h, $(capture).hxx, $(capture).hh",
99 | "*.dart": "$(capture).freezed.dart, $(capture).g.dart",
100 | "*.db": "*.db-shm, *.db-wal",
101 | "*.ex": "$(capture).html.eex, $(capture).html.heex, $(capture).html.leex",
102 | "*.fs": "$(capture).fs.js, $(capture).fs.js.map, $(capture).fs.jsx, $(capture).fs.ts, $(capture).fs.tsx, $(capture).fs.rs, $(capture).fs.php, $(capture).fs.dart",
103 | "*.gd": "$(capture).gd.uid",
104 | "*.go": "$(capture)_test.go",
105 | "*.java": "$(capture).class",
106 | "*.js": "$(capture).js.map, $(capture).*.js, $(capture)_*.js, $(capture).d.ts, $(capture).d.ts.map, $(capture).js.flow",
107 | "*.jsx": "$(capture).js, $(capture).*.jsx, $(capture)_*.js, $(capture)_*.jsx, $(capture).css, $(capture).module.css, $(capture).less, $(capture).module.less, $(capture).module.less.d.ts, $(capture).scss, $(capture).module.scss, $(capture).module.scss.d.ts",
108 | "*.master": "$(capture).*.cs, $(capture).*.vb",
109 | "*.md": "$(capture).*",
110 | "*.mjs": "$(capture).mjs.map, $(capture).*.mjs, $(capture)_*.mjs",
111 | "*.module.ts": "$(capture).resolver.ts, $(capture).controller.ts, $(capture).service.ts",
112 | "*.mts": "$(capture).mts.map, $(capture).*.mts, $(capture)_*.mts",
113 | "*.proto": "$(capture).pb.go, $(capture).pb.micro.go",
114 | "*.pubxml": "$(capture).pubxml.user",
115 | "*.py": "$(capture).pyi",
116 | "*.razor": "$(capture).razor.cs, $(capture).razor.css, $(capture).razor.scss",
117 | "*.resx": "$(capture).*.resx, $(capture).designer.cs, $(capture).designer.vb",
118 | "*.tex": "$(capture).acn, $(capture).acr, $(capture).alg, $(capture).aux, $(capture).bbl, $(capture).bbl-SAVE-ERROR, $(capture).bcf, $(capture).bib, $(capture).blg, $(capture).fdb_latexmk, $(capture).fls, $(capture).glg, $(capture).glo, $(capture).gls, $(capture).idx, $(capture).ind, $(capture).ist, $(capture).lof, $(capture).log, $(capture).lot, $(capture).nav, $(capture).out, $(capture).run.xml, $(capture).snm, $(capture).synctex.gz, $(capture).toc, $(capture).xdv",
119 | "*.ts": "$(capture).js, $(capture).d.ts.map, $(capture).*.ts, $(capture)_*.js, $(capture)_*.ts",
120 | "*.tsx": "$(capture).ts, $(capture).*.tsx, $(capture)_*.ts, $(capture)_*.tsx, $(capture).css, $(capture).module.css, $(capture).less, $(capture).module.less, $(capture).module.less.d.ts, $(capture).scss, $(capture).module.scss, $(capture).module.scss.d.ts, $(capture).css.ts",
121 | "*.vbproj": "*.config, *proj.user, appsettings.*, bundleconfig.json",
122 | "*.vue": "$(capture).*.ts, $(capture).*.js, $(capture).story.vue",
123 | "*.w": "$(capture).*.w, I$(capture).w",
124 | "*.wat": "$(capture).wasm",
125 | "*.xaml": "$(capture).xaml.cs"
126 | },
127 | ```
128 |
129 | ## Contributing
130 |
131 | The snippet is generated by script, do not edit the README directly.
132 | Instead, go to `update.mjs`, make changes and then submit a PR. Thanks!
133 |
134 | ## License
135 |
136 | MIT
137 |
--------------------------------------------------------------------------------
/eslint.config.js:
--------------------------------------------------------------------------------
1 | // @ts-check
2 | import antfu from '@antfu/eslint-config'
3 | import { createSimplePlugin } from 'eslint-factory'
4 |
5 | export default antfu(
6 | {},
7 | createSimplePlugin({
8 | include: ['update.mjs'],
9 | name: 'wildcards-check',
10 | create(context) {
11 | return {
12 | Literal(node) {
13 | if (typeof node.value !== 'string')
14 | return
15 | const parts = node.value.split(',')
16 | for (const part of parts) {
17 | if (part.split('*').length > 2) {
18 | context.report({
19 | node,
20 | message: `Only one wildcard is allowed in patterns, but got "${part}"`,
21 | })
22 | }
23 | }
24 | },
25 | }
26 | },
27 | }),
28 | )
29 |
--------------------------------------------------------------------------------
/extension/.vscodeignore:
--------------------------------------------------------------------------------
1 | .github/**
2 | .vscode/**
3 | .vscode-test/**
4 | node_modules
5 |
--------------------------------------------------------------------------------
/extension/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2022-Present Anthony Fu
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/extension/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | File Nesting Updater
8 |
9 |
10 | Auto updater for vscode-file-nesting-config
.
11 | A config to make your file tree cleaner with the file nesting feature of VS Code.
12 |
13 |
14 |
15 |
16 |
17 |
18 | 
19 |
20 | ## Configurations
21 |
22 | ```json
23 | {
24 | "fileNestingUpdater.autoUpdate": true,
25 | "fileNestingUpdater.autoUpdateInterval": 720,
26 | "fileNestingUpdater.promptOnAutoUpdate": true,
27 | "fileNestingUpdater.upstreamRepo": "antfu/vscode-file-nesting-config",
28 | "fileNestingUpdater.upstreamBranch": "main"
29 | }
30 | ```
31 |
32 | It will check for update every 12 hours by default. You can also do it manually by executing command `File Nesting Updater: Update config now`.
33 |
34 | ## License
35 |
36 | MIT
37 |
--------------------------------------------------------------------------------
/extension/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "publisher": "antfu",
3 | "name": "file-nesting",
4 | "displayName": "File Nesting Updater",
5 | "type": "module",
6 | "version": "2.0.0",
7 | "private": true,
8 | "description": "Auto updating for Anthony's file nesting config",
9 | "license": "MIT",
10 | "repository": {
11 | "type": "git",
12 | "url": "https://github.com/antfu/vscode-file-nesting-config",
13 | "directory": "extension"
14 | },
15 | "categories": [
16 | "Other"
17 | ],
18 | "main": "./dist/index.js",
19 | "preview": true,
20 | "icon": "res/logo.png",
21 | "engines": {
22 | "vscode": "^1.100.0"
23 | },
24 | "activationEvents": [
25 | "onStartupFinished"
26 | ],
27 | "contributes": {
28 | "commands": [
29 | {
30 | "command": "antfu.file-nesting.manualUpdate",
31 | "title": "Update config now",
32 | "category": "File Nesting Updater"
33 | }
34 | ],
35 | "configuration": {
36 | "type": "object",
37 | "title": "File Nesting Updater",
38 | "properties": {
39 | "fileNestingUpdater.autoUpdate": {
40 | "type": "boolean",
41 | "description": "Fetch and update the latest config automatically",
42 | "default": true
43 | },
44 | "fileNestingUpdater.promptOnAutoUpdate": {
45 | "type": "boolean",
46 | "description": "Should show up the prompt before doing auto update",
47 | "default": true
48 | },
49 | "fileNestingUpdater.autoUpdateInterval": {
50 | "type": "number",
51 | "description": "The minimal interval for auto update, in minutes",
52 | "default": 4320
53 | },
54 | "fileNestingUpdater.upstreamRepo": {
55 | "type": "string",
56 | "description": "The upstream repo you want to update from",
57 | "default": "antfu/vscode-file-nesting-config"
58 | },
59 | "fileNestingUpdater.upstreamBranch": {
60 | "type": "string",
61 | "description": "The branch name of upstream repo",
62 | "default": "main"
63 | }
64 | }
65 | }
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/extension/res/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/antfu/vscode-file-nesting-config/af61e7ad000a4601b70d4fb60ac4e4765554738b/extension/res/logo.png
--------------------------------------------------------------------------------
/extension/res/logo.svg:
--------------------------------------------------------------------------------
1 |
7 |
--------------------------------------------------------------------------------
/extension/src/config.ts:
--------------------------------------------------------------------------------
1 | import { workspace } from 'vscode'
2 |
3 | export function getConfig(key: string): T | undefined {
4 | return workspace
5 | .getConfiguration()
6 | .get(key)
7 | }
8 |
9 | export async function setConfig(key: string, value: any, isGlobal = true) {
10 | // update value
11 | return await workspace
12 | .getConfiguration()
13 | .update(key, value, isGlobal)
14 | }
15 |
--------------------------------------------------------------------------------
/extension/src/constants.ts:
--------------------------------------------------------------------------------
1 | export const URL_PREFIX = 'https://cdn.jsdelivr.net/gh'
2 | export const FILE = 'README.md'
3 | export const MSG_PREFIX = 'File Nesting Updater:'
4 |
--------------------------------------------------------------------------------
/extension/src/fetch.ts:
--------------------------------------------------------------------------------
1 | import type { ExtensionContext } from 'vscode'
2 | import { fetch } from 'ofetch'
3 | import { window, workspace } from 'vscode'
4 | import { getConfig } from './config'
5 | import { FILE, MSG_PREFIX, URL_PREFIX } from './constants'
6 |
7 | export async function fetchLatest() {
8 | const repo = getConfig('fileNestingUpdater.upstreamRepo')
9 | const branch = getConfig('fileNestingUpdater.upstreamBranch')
10 | const url = `${URL_PREFIX}/${repo}@${branch}/${FILE}`
11 | const md = await fetch(url).then(r => r.text())
12 | const content = (md.match(/```jsonc([\s\S]*?)```/) || [])[1] || ''
13 |
14 | const json = `{${
15 | content
16 | .trim()
17 | .split(/\n/g)
18 | .filter(line => !line.trim().startsWith('//'))
19 | .join('\n')
20 | .slice(0, -1)
21 | }}`
22 |
23 | const config = JSON.parse(json) || {}
24 | return config['explorer.fileNesting.patterns']
25 | }
26 |
27 | export async function fetchAndUpdate(ctx: ExtensionContext, prompt = true) {
28 | const config = workspace.getConfiguration()
29 | const patterns = await fetchLatest()
30 | let shouldUpdate = true
31 |
32 | const oringalPatterns = { ...(config.get