Skip to content

Commit

Permalink
Merge pull request #4 from atom-ide-community/strict
Browse files Browse the repository at this point in the history
  • Loading branch information
aminya authored Jul 18, 2020
2 parents 479d6ab + 6989d09 commit ef35f03
Show file tree
Hide file tree
Showing 2 changed files with 90 additions and 0 deletions.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,21 @@ Create a `.eslintrc.json` file at the root of the project with the following con
```
`ignorePatterns` is the Eslint ignore paths.


Add a lint script to your `package.json`:
```json
"lint": "eslint . --fix"
```

## Strict Version
You can instead use the `strict` version which throws errors instead of warning:
```json
{
"extends": "eslint-config-atomic/strict",
"ignorePatterns": ["dist/", "node_modules/"]
}
```

## Behind the scenes

This configuration lints JavaScript, TypeScript, CoffeeScript, JSON, and YAML.
75 changes: 75 additions & 0 deletions strict.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
module.exports = {
// JS Files
"root": true,
"env": {
"atomtest": true,
"es6": true,
"node": true,
"browser": true,
"jasmine": true
},
"globals": {
"atom": "readonly",
"measure": "readonly"
},
"parser": "babel-eslint",
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": 2018,
"sourceType": "module"
},
"plugins": ["prettier"],
"extends": ["prettier", "eslint:recommended"],
"ignorePatterns": ["node_modules/"],
"overrides": [
{
// Bundled node version with atom has an old ESLint
// TypeScript files
"files": ["**/*.ts", "**/*.tsx"],
"parser": "@typescript-eslint/parser",
"plugins": ["prettier", "@typescript-eslint"],
"extends": [
"prettier",
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended"
],
"rules": {
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/camelcase": "off",
"@typescript-eslint/no-use-before-define": "off",
"@typescript-eslint/member-delimiter-style": "off"
}
},
{
// JSON files
"files": ["*.json"],
"plugins": ["json"],
"extends": ["prettier", "plugin:json/recommended"],
"rules": {
"json/*": [
"error",
{
"allowComments": true
}
]
}
},
{
// CoffeeScript files
"files": ["**/*.coffee"],
"parser": "eslint-plugin-coffee",
"plugins": ["coffee"],
"extends": ["plugin:coffee/eslint-recommended"]
},
{
// YAML files
"files": ["*.yaml", "*.yml"],
"plugins": ["yaml"],
"extends": ["plugin:yaml/recommended"]
}
]
}

0 comments on commit ef35f03

Please sign in to comment.