{"id":15046154,"url":"https://github.com/gmullerb/any-eslint-parser","last_synced_at":"2025-10-26T02:31:22.238Z","repository":{"id":57180860,"uuid":"365751084","full_name":"gmullerb/any-eslint-parser","owner":"gmullerb","description":"Check Any file with ESLint","archived":false,"fork":false,"pushed_at":"2021-05-29T18:15:04.000Z","size":52,"stargazers_count":4,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-15T18:32:24.722Z","etag":null,"topics":["eslint-parser","eslint-rules","lintspaces","regex-rules"],"latest_commit_sha":null,"homepage":"https://any-eslint-parser.github.io","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gmullerb.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-05-09T12:47:25.000Z","updated_at":"2024-06-05T07:51:53.000Z","dependencies_parsed_at":"2022-09-14T03:40:48.376Z","dependency_job_id":null,"html_url":"https://github.com/gmullerb/any-eslint-parser","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gmullerb%2Fany-eslint-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gmullerb%2Fany-eslint-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gmullerb%2Fany-eslint-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gmullerb%2Fany-eslint-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gmullerb","download_url":"https://codeload.github.com/gmullerb/any-eslint-parser/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":236526245,"owners_count":19163270,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["eslint-parser","eslint-rules","lintspaces","regex-rules"],"created_at":"2024-09-24T20:52:46.850Z","updated_at":"2025-10-26T02:31:21.897Z","avatar_url":"https://github.com/gmullerb.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://any-eslint-parser.github.io/\"\u003e\u003cimg src=\"docs/any-eslint-parser.png\" alt=\" \"/\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003ch1 align=\"center\"\u003eCheck Any file with ESLint\u003c/h1\u003e\n\n[![any-eslint-parser](https://badgen.net/badge/homepage/any-eslint-parser/blue)](https://any-eslint-parser.github.io/)\n[![any-eslint-parser](https://badgen.net/badge/npm%20pack/any-eslint-parser/blue)](https://www.npmjs.com/package/any-eslint-parser)\n[![ ](https://badgen.net/npm/v/any-eslint-parser)](https://www.npmjs.com/package/any-eslint-parser)\n[![License](https://img.shields.io/github/license/mashape/apistatus.svg)](LICENSE.txt)\n[![Github repo](https://badgen.net/badge/icon/github?icon=github\u0026label)](https://github.com/gmullerb/any-eslint-parser)\n[![Gitlab repo](https://badgen.net/badge/icon/gitlab?icon=gitlab\u0026label)](https://gitlab.com/gmullerb/any-eslint-parser)\n__________________\n\n## Quick Start\n\n1 . Add dependencies:\n\n`package.json`:\n\n```json\n  ..\n  \"devDependencies\": {\n    \"any-eslint-parser\": \"1.0.0\",\n    \"eslint\": \"*\",\n```\n\n2 . Configure eslint with the required rules, e.g. `eol-last` and `no-tabs`:\n\n`.eslintrc-any.json`:\n\n```json\n{\n  \"parser\": \"any-eslint-parser\",\n  \"rules\": {\n    \"eol-last\": \"error\",\n    \"no-tabs\": \"error\"\n  }\n}\n```\n\n\u003e Any eslint rule that not required AST can be used, this example uses `eol-last` and `no-tabs`.\n\n3 . Configure linting script:\n\n`package.json`:\n\n```json\n  \"scripts\": {\n    \"lint.any\": \"eslint --config .eslintrc-any.json \\\"**/*.+(js|jsx|ts|tsx|json|yml|xml|sh|txt|md|svg|properties|gradle|java|cpp|c|html|css|groovy|gitignore|npmignore)\\\"\",\n```\n\n__________________\n\n## Goals\n\n`any-eslint-parser` provides a parser so \"any\" type of file can be checked by [eslint](https://eslint.org). Although eslint claims to be AST-based, there are rules that does not based on AST, rather they are based on the **text content** of the file, e.g. [`eol-last`](https://eslint.org/docs/rules/eol-last), [`no-tabs`](https://eslint.org/docs/rules/no-tabs), [`eslint-plugin-regex`](https://eslint-plugin-regex.github.io), etc.\n`any-eslint-parser` can be used to check json files, yaml files, script files, source code files in any programming language (e.g. java, c++, groovy, etc.), svg files, markdown files, etc.\n\n![any-eslint-parser](docs/how-any-eslint-parser-works.png)\n\n\u003e This idea arise from the need to use [`eslint-plugin-regex`](https://eslint-plugin-regex.github.io) in other type of files, besides javascript. (Then saw on this as a more versatile and configurable way to check common files than using lintspaces)\n\n* Rules that required AST will simply be ignored, i.e. no error will be reported.\n  * Neither the [list of eslint rules](https://eslint.org/docs/rules/), nor rules description provide explicit information on whether they need AST or not, so, You may need to test the rules before using, or use regex rules aka [`eslint-plugin-regex`](https://eslint-plugin-regex.github.io).\n* Cascading and Hierarchy of ESlint Configuration files are still applied.\n  * Remember if `eslintrc-any.json` or any parent have rules that require AST, those will be ignored when using `any-eslint-parser`.\n  * You may want to use an independent `.eslintrc.json` file when using `any-eslint-parser` (take a look at [Migrating to eslint/any-eslint-parser from lintspaces](https://any-eslint-parser.github.io/docs/migration.html) as detailed example).\n    * Using [`--no-eslintrc`](https://eslint.org/docs/user-guide/command-line-interface#-no-eslintrc) option can be very helpful since will ignore all configuration files, i.e `.eslintrc.*` and `package.json`, only taking in account the one set with [`--config`](https://eslint.org/docs/user-guide/command-line-interface#-c-config) option.\n    * May want to ignore some folders or files using [`--ignore-pattern`](https://eslint.org/docs/user-guide/command-line-interface#-ignore-pattern) or [`--ignore-path`](https://eslint.org/docs/user-guide/command-line-interface#-ignore-path).\n    * All these options [`--no-eslintrc`](https://eslint.org/docs/user-guide/command-line-interface#-no-eslintrc), [`--ignore-pattern`](https://eslint.org/docs/user-guide/command-line-interface#-ignore-pattern) and [`--ignore-path`](https://eslint.org/docs/user-guide/command-line-interface#-ignore-path) are very useful when other parser are used in the project in order to avoid conflicts.\n\n## Examples\n\n### Replacing lintspaces\n\n`.eslintrc-any.json`\n\n```json\n  {\n    \"parser\": \"any-eslint-parser\",\n    \"rules\": {\n      \"eol-last\": \"error\",\n      \"no-tabs\": \"error\"\n    }\n  }\n```\n\n`package.json`:\n\n```json\n  \"scripts\": {\n    \"lint.any\": \"eslint --config .eslintrc-any.json \\\"**/[\\\\.a-zA-Z]*.+(js|jsx|ts|tsx|json|yml|xml|sh|txt|md|svg|properties|gradle|java|cpp|c|html|css|groovy)\\\" \\\"**/.+(|gitignore|npmignore)\\\" --no-eslintrc --ignore-pattern \\\"build\\\"\"\n  },\n  \"devDependencies\": {\n    \"any-eslint-parser\": \"1.0.0\",\n    \"eslint\": \"*\"\n  }\n```\n\nMore detail at [Migrating to eslint/any-eslint-parser from lintspaces](https://any-eslint-parser.github.io/docs/migration.html).\n\n### Using [`eslint-plugin-regex`](https://eslint-plugin-regex.github.io)\n\nRequiring `Copyright` and `License` on every source file of a project.\n\n`.eslintrc-any.json`\n\n```json\n  {\n    \"plugins\": [\"regex\"],\n    \"parser\": \"any-eslint-parser\",\n    \"rules\": {\n      \"regex/required\": [\n        \"error\", [\n          \"^(?:(?:\\\\/\\\\/)|#) Copyright \\\\(c\\\\) Super Team\",\n          \"^(?:(?:\\\\/\\\\/)|#) Licensed under the MIT License \\\\(MIT\\\\), see LICENSE.txt\"\n        ]\n      ]\n    }\n  }\n```\n\n`package.json`:\n\n```json\n  \"scripts\": {\n    \"lint.any\": \"eslint --config .eslintrc-any.json \\\"**/*.+(js|jsx|ts|tsx|gradle|java|cpp|c|groovy|yml|sh)\\\"\"\n  },\n  \"devDependencies\": {\n    \"any-eslint-parser\": \"1.0.0\",\n    \"eslint\": \"*\",\n    \"eslint-plugin-regex\": \"*\"\n  }\n```\n\nMore regex rules examples at [`eslint-plugin-regex`](https://eslint-plugin-regex.github.io) and [`eslint-plugin-base-style-config`](https://github.com/gmullerb/base-style-config/tree/HEAD/js/config/configs/regex) regex rules.\n\n__________________\n\n## Prerequisites\n\n* [`\"eslint\": \"*\"`](https://www.npmjs.com/package/eslint).\n\n__________________\n\n## Contributing\n\n* **Use it**.\n* **Share it**.\n* [Give it a Star](https://github.com/gmullerb/any-eslint-parser).\n* [Propose changes or improvements](https://github.com/gmullerb/any-eslint-parser/issues).\n* [Report bugs](https://github.com/gmullerb/any-eslint-parser/issues).\n\n## License\n\n[MIT License](LICENSE.txt)\n__________________\n\n## Remember\n\n* Use code style verification tools =\u003e Encourages Best Practices, Efficiency, Readability and Learnability.\n* Code Review everything =\u003e Encourages Functional suitability, Performance Efficiency and Teamwork.\n* If viable, Start testing early =\u003e Encourages Reliability and Maintainability.\n\n## Additional words\n\nDon't forget:\n\n* **Love what you do**.\n* **Learn everyday**.\n* **Learn yourself**.\n* **Share your knowledge**.\n* **Think different!**.\n* **Learn from the past, dream on the future, live and enjoy the present to the max!**.\n* **Enjoy and Value the Quest** (It's where you learn and grow).\n\nAt life:\n\n* Let's act, not complain.\n* Be flexible.\n\nAt work:\n\n* Let's give solutions, not questions.\n* Aim to simplicity not intellectualism.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgmullerb%2Fany-eslint-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgmullerb%2Fany-eslint-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgmullerb%2Fany-eslint-parser/lists"}