Skip to content

[RRFC] Don't expand tabs by default #420

Closed
@dgchrt

Description

@dgchrt

Motivation ("The Why")

Expanded tabs can be harmful to some developers and should be avoided. Currently, new packages created with npm init produce package*.json files with their tabs expanded to a couple spaces, which in turn won't respect editor configurations. This can be specially harmful to developers which rely on custom editor configurations. The whole motivation for this is having the concept of "safe defaults" in place for the broader community.

Example

Generate the new files with their tabs intact instead.

How

Current Behaviour

Tabs expanded to a couple spaces:

{
  "name": "test",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC"
}

Desired Behaviour

Intact tabs:

{
	"name": "test",
	"version": "1.0.0",
	"description": "",
	"main": "index.js",
	"scripts": {
		"test": "echo \"Error: no test specified\" && exit 1"
	},
	"author": "",
	"license": "ISC"
}

References

Please refer to this article if you're new to the subject: https://alexandersandberg.com/tabs-for-accessibility/
This issue was previously discussed here: npm/feedback#200

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions