Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(filenames): add patterns support #2289

Closed
wants to merge 2 commits into from

Conversation

Airkro
Copy link
Contributor

@Airkro Airkro commented Apr 20, 2024

Work in progress

From: #2282 (comment)

Many popular tools, like eslint/stylelint/prettier/syncpack/postcss/babel/graphql/commitlint... use config loaders like cosmiconfig/lilconfig/unoconfig/rc-loader...

They all have a long filename list like this, For now, many of them are still not completing the list.

Currently, people help maintain these filenames by creating similar patterns and checking them line by line to identify which ones are missing. This process results in numerous pull requests.

I create some helper functions as built-in support? It will make the list shorter, and easy to maintain, and easy to send PR in the future.

image

@Airkro Airkro force-pushed the filename-patterns branch 2 times, most recently from 4f45333 to a245001 Compare April 22, 2024 13:05
src/icons/patterns/utils.ts Outdated Show resolved Hide resolved
@Airkro
Copy link
Contributor Author

Airkro commented Apr 22, 2024

@PKief

Now only 4 patterns are left behind, they are used frequently, input xyz123 as the key, and get:

Ecmascript:
  - xyz123.js
  - xyz123.mjs
  - xyz123.cjs
  - xyz123.ts
  - xyz123.mts
  - xyz123.cts

Configuration:
  - xyz123.json
  - xyz123.jsonc
  - xyz123.json5
  - xyz123.yaml
  - xyz123.yml
  - xyz123.toml

NodeEcosystem:
  - xyz123.json
  - xyz123.jsonc
  - xyz123.json5
  - xyz123.yaml
  - xyz123.yml
  - xyz123.toml
  - xyz123.js
  - xyz123.mjs
  - xyz123.cjs
  - xyz123.ts
  - xyz123.mts
  - xyz123.cts
  
Cosmiconfig:
  - .xyz123rc
  - .xyz123rc.json
  - .xyz123rc.jsonc
  - .xyz123rc.json5
  - .xyz123rc.yaml
  - .xyz123rc.yml
  - .xyz123rc.toml
  - .xyz123rc.js
  - .xyz123rc.mjs
  - .xyz123rc.cjs
  - .xyz123rc.ts
  - .xyz123rc.mts
  - .xyz123rc.cts
  - .config/xyz123rc
  - .config/xyz123rc.json
  - .config/xyz123rc.jsonc
  - .config/xyz123rc.json5
  - .config/xyz123rc.yaml
  - .config/xyz123rc.yml
  - .config/xyz123rc.toml
  - .config/xyz123rc.js
  - .config/xyz123rc.mjs
  - .config/xyz123rc.cjs
  - .config/xyz123rc.ts
  - .config/xyz123rc.mts
  - .config/xyz123rc.cts
  - xyz123.config.json
  - xyz123.config.jsonc
  - xyz123.config.json5
  - xyz123.config.yaml
  - xyz123.config.yml
  - xyz123.config.toml
  - xyz123.config.js
  - xyz123.config.mjs
  - xyz123.config.cjs
  - xyz123.config.ts
  - xyz123.config.mts
  - xyz123.config.cts

@Airkro Airkro marked this pull request as ready for review April 22, 2024 14:21
PKief added a commit that referenced this pull request Apr 22, 2024
@PKief
Copy link
Owner

PKief commented Apr 22, 2024

Merged with d6c1c09

@PKief PKief closed this Apr 22, 2024
@Airkro Airkro deleted the filename-patterns branch April 23, 2024 00:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants