{"id":16281074,"url":"https://github.com/schorfes/grunt-lintspaces","last_synced_at":"2026-04-10T15:24:26.429Z","repository":{"id":10532598,"uuid":"12726010","full_name":"schorfES/grunt-lintspaces","owner":"schorfES","description":"A Grunt task for checking spaces in files.","archived":false,"fork":false,"pushed_at":"2024-10-16T16:54:06.000Z","size":1144,"stargazers_count":31,"open_issues_count":0,"forks_count":10,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-29T02:02:55.335Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://npmjs.com/package/grunt-lintspaces","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"wdavidw/node-connect-dojo","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/schorfES.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-09-10T09:48:54.000Z","updated_at":"2024-10-16T16:13:26.000Z","dependencies_parsed_at":"2024-06-08T21:22:22.108Z","dependency_job_id":"db9c69b1-50c8-4d3c-8d93-9bd6a9cfc443","html_url":"https://github.com/schorfES/grunt-lintspaces","commit_stats":{"total_commits":203,"total_committers":11,"mean_commits":"18.454545454545453","dds":0.4482758620689655,"last_synced_commit":"d533ac532363d5390eecced5a9e96c8bf0ad934e"},"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schorfES%2Fgrunt-lintspaces","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schorfES%2Fgrunt-lintspaces/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schorfES%2Fgrunt-lintspaces/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schorfES%2Fgrunt-lintspaces/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/schorfES","download_url":"https://codeload.github.com/schorfES/grunt-lintspaces/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247280229,"owners_count":20912967,"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-10-10T19:04:52.326Z","updated_at":"2026-04-10T15:24:26.423Z","avatar_url":"https://github.com/schorfES.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# grunt-lintspaces\n\nA Grunt task for checking spaces in files depending on the node module\n[lintspaces](https://github.com/schorfES/node-lintspaces).\n\n[![CI Status](https://github.com/schorfES/grunt-lintspaces/actions/workflows/ci.yml/badge.svg)](https://github.com/schorfES/grunt-lintspaces/actions)\n\nIf you're looking for a [gulpjs](http://gulpjs.com/) task to validate your\nfiles, take a look at this one:\n\n* [gulp-lintspaces](https://github.com/AlbertoElias/gulp-lintspaces)\n\n## Issues \u0026 feature requests\n\nThis grunt task is just a wrapper for the node module called\n[lintspaces](https://github.com/schorfES/node-lintspaces). If you have any\nissues or feature requests, please consider if this may belongs to the node\nmodule its self.\n\n## Getting Started\n_If you haven't used [grunt](http://gruntjs.com/) before, be sure to check out\nthe [Getting Started](http://gruntjs.com/getting-started) guide._\n\nFrom the same directory as your project's Gruntfile and package.json, install\nthis plugin with the following command:\n\n```bash\nnpm install grunt-lintspaces --save-dev\n```\n\nOnce that's done, add this line to your project's Gruntfile:\n\n```js\ngrunt.loadNpmTasks('grunt-lintspaces');\n```\n\nInside your `grunt.js` file add a section named `lintspaces`. This section\nspecifies the tasks. Each task takes sources and options as parameters.\n\n## Parameters\n\n### sources ```src```\n\nThis sets the path of the files to be checked.\n\n## Options\n\n### newline at end of file option\n\nTests for newlines at the end of all files. Default value is `false`.\n\n```javascript\n\tnewline: true\n```\n\n* returns code ```NEWLINE```, when a missing a newline at the end of the file.\n* returns code ```NEWLINE_AMOUNT```, when found unexpected additional newlines\nat the end of a file.\n* returns type ```warning```\n\n### maximum newlines option\n\nTest for the maximum amount of newlines between code blocks. Default value is\n`false`. To enable this validation a number larger than `0` is expected.\n\n```javascript\n\tnewlineMaximum: 2\n```\n\n* returns code ```NEWLINE_MAXIMUM```, when maximum amount of newlines exceeded\nbetween code blocks.\n* returns type ```warning```\n\n### endOfLine option\n\nLintspaces fails with incorrect end of line errors when files contain lines that\nend in the wrong sequence. Default value is `false`. To enable end of line checks\nuse any of the following values: `'LF'` or `'CRLF'` or `'CR'`. Values are\ncase-insensitive. Note that this option checks all lines; even \"ignored\" lines.\n\n```javascript\n    endOfLine: 'lf'\n```\n\n* returns code ```END_OF_LINE```, when the wrong line ending sequence is found.\n* returns type ```warning```\n\n### trailingspaces option\n\nTests for useless whitespaces (trailing whitespaces) at each lineending of all\nfiles. Default value is `false`.\n\n```javascript\n\ttrailingspaces: true\n```\n\n* returns code ```TRAILINGSPACES```, when unexpected trailing spaces were found.\n* returns type ```warning```\n\n**Note:** If you like to to skip empty lines from reporting (for whatever\nreason), use the option ```trailingspacesSkipBlanks``` and set them to ```true```.\n\n### indentation options\n\nTests for correct indentation using tabs or spaces. Default value is `false`.\nTo enable indentation check use the value `'tabs'` or `'spaces'`.\n\n```javascript\n\tindentation: 'tabs'\n```\n\n* returns code ```INDENTATION_TABS```, when spaces are used instead of tabs.\n* returns type ```warning```\n\nIf the indentation option is set to `'spaces'`, there is also the possibility\nto set the amount of spaces per indentation using the `spaces` option. Default\nvalue is `4`.\n\n```javascript\n\tindentation: 'spaces',\n\tspaces: 2\n```\n\n* returns code ```INDENTATION_SPACES```, when tabs are used instead of spaces.\n* returns code ```INDENTATION_SPACES_AMOUNT```, when spaces are used but the\namound is not as expected.\n* returns type ```warning```\n\n### guess indentation option\n\nThis ```indentationGuess``` option _tries to guess_ the indention of a line\ndepending on previous lines. The report of this option can be incorrect,\nbecause the _correct_ indentation depends on the actual programming language\nand styleguide of the certain file. The default value is `false` - disabled.\n\nThis feature follows the following rules: _The indentation of the current\nline is correct when:_\n\n* the amount of indentations is equal to the previous or\n* the amount of indentations is less than the previous line or\n* the amount of indentations is one more than the previous line\n* the amount of indentations is zero and the lines length is also zero which\nis an empty line without trailing whitespaces\n\n```javascript\n\tindentationGuess: true\n```\n\n* returns code ```NEWLINE_GUESS```\n* returns type ```hint```\n\n### allowsBOM option\n\nLintspaces fails with incorrect indentation errors when files contain Byte Order\nMarks (BOM). If you don't want to give false positives for inconsistent tabs or\nspaces, set the ```allowsBOM``` option to ```true```.  The default value is\n`false` - disabled.\n\n```javascript\n\tallowsBOM: true\n```\n\n### ignores option\n\nUse the `ignores` option when special lines such as comments should be ignored.\nProvide an array of regular expressions to the `ignores` property.\n\n```javascript\n\tignores: [\n\t\t/\\/\\*[\\s\\S]*?\\*\\//g,\n\t\t/foo bar/g\n\t]\n```\n\nThere are some _**build in**_ ignores for comments which you can apply by using\nthese strings:\n\n* 'js-comments'\n* 'c-comments'\n* 'java-comments'\n* 'as-comments'\n* 'xml-comments'\n* 'html-comments'\n* 'python-comments'\n* 'ruby-comments'\n* 'applescript-comments'\n\n_(build in strings and userdefined regular expressions are mixable in the\n`ignores` array)_\n\n```javascript\n\tignores: [\n\t\t'js-comments',\n\t\t/foo bar/g\n\t]\n```\n\n_Feel free to contribute some new regular expressions as build in!_\n\n**Note:** Trailing spaces are not ignored by default, because they are always\nevil!! If you still want to ignore them use the ```trailingspacesToIgnores```\noption and set them to ```true```.\n\n**Note:** If endOfLine checking is enabled, then all lines (including\n\"ignored\" lines will be checked for appropriate end of line sequences.\n\n\n### .editorconfig option\n\nIt's possible to overwrite the default and given options by setting up a path\nto an external editorconfig file by using the `editorconfig` option. For a basic\nconfiguration of a _.editorconfig_ file check out the\n[EditorConfig Documentation](http://editorconfig.org/).\n\n```javascript\n\teditorconfig: '.editorconfig'\n```\n\nThe following .editorconfig values are supported:\n\n* `insert_final_newline` will check if a newline is set\n* `indent_style` will check the indentation\n* `indent_size` will check the amount of spaces\n* `trim_trailing_whitespace` will check for useless whitespaces\n* `end_of_line` will check the end of line character sequence\n\n### .rcconfig option\n\nLoad all settings from a RC configuration file. The configuration can be defined\nin ```ini``` or ```json``` format. When setting this option to ```true``` the\nconfiguration from a ```.lintspacesrc``` in the\n[RC standards load paths](https://github.com/dominictarr/rc#standards)\nwill be taken.\n\n```javascript\n\trcconfig: true\n```\n\nDefine a custom path to a RC configuration file of your choice by setting the\noption to the desired path.\n\n```javascript\n\trcconfig: 'path/to/.customrc'\n```\n\n### showValid option\n\nThis is a specific option related to this task. When active all valid processed\nfiles will be logged. Default value is `false`.\n\n```javascript\n\tshowValid: true\n```\n\n### showTypes option\n\nThis is a specific option related to this task. By default the type of each\nmessage is shown by the color of the message text. To show at the beginning of\nthe message set this to `true`. Default value is `false`.\n\n```javascript\n\tshowTypes: true\n```\n\n### showCodes option\n\nThis is a specific option related to this task. When active all reporting codes\nwill appear at the end of each message. Default value is `false`.\n\n```javascript\n\tshowCodes: true\n```\n\n### junit option\n\nWhen adding a path as string for the `junit` option, the grunt task will write\na junit xml report to the specified path. Default value is `false` – disabled.\n\n```javascript\n\tjunit: '.grunt/junit-lintspaces.xml'\n```\n\n## Configuration Examples\n\n```javascript\nlintspaces: {\n\tall: {\n\t\tsrc: [\n\t\t\t'**/*'\n\t\t],\n\t\toptions: {\n\t\t\tnewline: true,\n\t\t\tnewlineMaximum: 2,\n\t\t\ttrailingspaces: true,\n\t\t\tindentation: 'spaces',\n\t\t\tspaces: 2\n\t\t}\n\t},\n\tjavascript: {\n\t\tsrc: [\n\t\t\t'js/src/**/*.js'\n\t\t],\n\t\toptions: {\n\t\t\tnewline: true,\n\t\t\ttrailingspaces: true,\n\t\t\tindentation: 'tabs',\n\t\t\tignores: ['js-comments']\n\t\t}\n\t},\n\texternal: {\n\t\tsrc: [\n\t\t\t'**/*'\n\t\t],\n\t\toptions: {\n\t\t\teditorconfig: '.editorconfig'\n\t\t}\n\t}\n}\n```\n\n## Contribution\n\n### Tests \u0026 Validation\n\nRun `grunt` to lint and run the tests.\n\n## License\n\n[LICENSE (MIT)](https://github.com/schorfES/grunt-lintspaces/blob/main/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fschorfes%2Fgrunt-lintspaces","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fschorfes%2Fgrunt-lintspaces","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fschorfes%2Fgrunt-lintspaces/lists"}