{"id":20409096,"url":"https://github.com/tcorral/eslint-audio-formatter","last_synced_at":"2025-04-12T15:41:19.170Z","repository":{"id":57227612,"uuid":"60381810","full_name":"tcorral/eslint-audio-formatter","owner":"tcorral","description":"Audio formatter/reporter for EsLint to get the reports in mp3 files with all the errors and warnings.","archived":false,"fork":false,"pushed_at":"2016-06-07T13:46:52.000Z","size":262,"stargazers_count":7,"open_issues_count":6,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-08T22:02:39.201Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/tcorral.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-06-03T22:40:48.000Z","updated_at":"2023-06-28T21:43:11.000Z","dependencies_parsed_at":"2022-09-12T17:00:32.786Z","dependency_job_id":null,"html_url":"https://github.com/tcorral/eslint-audio-formatter","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tcorral%2Feslint-audio-formatter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tcorral%2Feslint-audio-formatter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tcorral%2Feslint-audio-formatter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tcorral%2Feslint-audio-formatter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tcorral","download_url":"https://codeload.github.com/tcorral/eslint-audio-formatter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248590830,"owners_count":21129893,"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":[],"created_at":"2024-11-15T05:39:34.958Z","updated_at":"2025-04-12T15:41:19.129Z","avatar_url":"https://github.com/tcorral.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [eslint](https://github.com/eslint/eslint)-audio-formatter\n\u003e Audio formatter/reporter for EsLint to get a mp3 files with all the errors and warnings.\n\n[![NPM Version](http://img.shields.io/npm/v/eslint-audio-formatter.svg?style=flat)](https://npmjs.org/package/eslint-audio-formatter)\n[![Build Status](http://img.shields.io/travis/tcorral/eslint-audio-formatter.svg?style=flat)](https://travis-ci.org/tcorral/eslint-audio-formatter)\n\n## Motivation for this module\n\nI decided to use [eslint](https://github.com/eslint/eslint) to verify my code and sadly there was no reporter to mp3.\nThe idea of this report is to improve the accesibility of this report but not only for people with visual disability.\nOnce you have the mp3 file you can use other robots:\n\n* Slack\n* HipChat\n* Twitter\n* Twilio...\n\n\u003e The mp3 file is stored in a ```mp3-report-output``` folder at  \n\u003e the same root as the folder that contains the analyzed file.\n\n- All the errors are reported in natural language.\n\nTODO - Implement internationalization on messages so that you can listen the messages in your own language.\n\n## Installation\n\n### Dependencies:\n\n* node \u003e= 0.10\n* npm \u003e= 2.0.0\n* [audiosprite](https://github.com/tonistiigi/audiosprite) \u003e= 0.6.0\n* [say.js](https://github.com/marak/say.js) \u003e= 0.9.1\n\n```bash\nnpm install eslint-audio-formatter --save-dev\n```\n\n## Intellij/Webstorm/PhpStorm integration\n0. Install `eslint` and `eslint-audio-formatter`.\n\n   ```bash\n   npm install -D eslint eslint-audio-formatter\n   ```\n\n1. Add a script to your package json like:\n\n   ```javascript\n   {\n     \"scripts\": {\n       \"eslint\": \"eslint --format 'node_modules/eslint-audio-formatter/src/index.js' file1 file2 dir1/ dir2/\",\n     }\n   }\n   ```\n\n   **Note**: In windows you might not need the quotes around the path to the module.\n\n   ```javascript\n   {\n     \"scripts\": {\n       \"eslint\": \"eslint --format node_modules/eslint-audio-formatter/src/index.js file1 file2 dir1/ dir2/\",\n     }\n   }\n   ```\n2. Create a external tool to run eslint using this module as your formatter like this\n   - program: `npm`\n   - parameters: `run eslint`\n   - working directory: `$ProjectFileDir$`\n\n3. Use an output filter like: (Please note the 2 spaces before `$FILE_PATH$`)\n\n   ```bash\n     $FILE_PATH$.*:$LINE$.*:$COLUMN$\n   ```\n4. When launching the tool now the output files will be in the same level as the folder \nthat contains the analyzed file.  \n\n## Usage\n\nIn the command line\n\n```bash\n# just make sure you pass the path to the module to the format option of eslint\neslint --format './node_modules/eslint-audio-formatter/index.js' index.js\n```\n\nOr as a module\n\n```javascript\nvar eslint = require('eslint');\nvar opts = readJson('./path/to/options');\n\nvar engine = new eslint.CLIEngine( opts );\nvar report = engine.executeOnFiles( ['file1.js', 'file2.js'/*, ...*/] );\nvar results = report.results || [];\n\nvar formatter = require('eslint-audio-formatter');\nformatter(results);\n```\n\nIt works with `gulp` and `gulp-eslint`\n\n```javascript\nvar audioFormatter = require(\"eslint-audio-formatter\");\n// Your js task\ngulp.task(\"javascript\", function() {\n  return gulp.src([\"src/js/**/*.js\"])\n    // Your eslint pipe\n    .pipe(eslint(\".eslintrc\"))\n    .pipe(eslint.format(audioFormatter))\n    // Continue your other tasks\n    .pipe(concat(\"app.js\"))\n    .pipe(gulp.dest(\"dist/js\"))\n});\n```\n\nIt should work well in with eslint-grunt or grunt-eslint\n\n```javascript\ngrunt.initConfig({\n    // when using eslint-grunt:\n    eslint: {\n        options: {\n            formatter: './node_modules/eslint-audio-formatter'\n        }),\n        target1: {\n            //..\n        }\n    },\n    // when using grunt-eslint:\n    eslint: {\n        options: {\n            format: './node_modules/eslint-audio-formatter'\n        }),\n        target2: {\n            //..\n        }\n    }\n});\n```\n\nTo get more information I recommend to read the use cases in tests.\n\n## Formatter parameters\n\nWhen executed with EsLint we can pass arguments to change the voice and speed.\n\nTo pass variables to the formatter you have to add a double dash at the end of the eslint command.\n\n```\neslint --format './node_modules/eslint-audio-formatter' './test/data/with-syntax-errors.js' -- --eaf-voice=Vicki --eaf-speed=1\n```\n\n~~Eslint [does not support passing parameters to formatters from the cli](https://github.com/eslint/eslint/issues/2989) yet.So in order\nto pass parameters to the formatter we will have to rely on **environment variables**~~\n\n### Command line options\n\n#### --eaf-voice\n\nThis option requires one of the available voices in [say.js](https://github.com/marak/say.js/#os-x-notes)\n\n```bash\neslint -f node_modules/eslint-audio-formatter client/**/*.js server/**/*.js -- --eaf-voice=Vicki    # notice the --\n```\n\n#### --eaf-speed\n\nThis option changes the speed of the speech.\n\n```bash\neslint -f node_modules/eslint-audio-formatter client/**/*.js server/**/*.js -- --eaf-speed=0.65    # notice the --\n```\n\n**Important**: don't forget to add the flag at the end and after `-- ` otherwise it will be interpreted as a eslint parameter and will fail as that parameter is not known to eslint.\n\n\n## Tests\n\nTo run the tests with NodeUnit:\n\n```bash\nnpm install\nnpm test\n```\n\n## Contributing\n\n1. Fork it!\n2. Create your feature branch: `git checkout -b my-new-feature`\n3. Commit your changes: `git commit -am 'Add some feature'`\n4. Check that it still works: `npm test`\n4. Push to the branch: `git push origin my-new-feature`\n5. Submit a pull request :D\n\n## History\n\n0.1.0 - First release.\n\n## License\n\nThe MIT License (MIT)\n\nCopyright (c) 2016 Tomás Corral\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftcorral%2Feslint-audio-formatter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftcorral%2Feslint-audio-formatter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftcorral%2Feslint-audio-formatter/lists"}