Skip to content

Commit

Permalink
feat: added rule for 8.0.0~8.4.0 and change category (#15)
Browse files Browse the repository at this point in the history
* feat: added rule for 8.0.0~8.4.0 and
change category

* feat: tui/es6 로 구분하려면 이전 버전 쓰라고 명시
  • Loading branch information
chchoing authored Jan 6, 2022
1 parent 6ad3709 commit 9da4add
Show file tree
Hide file tree
Showing 15 changed files with 306 additions and 356 deletions.
22 changes: 2 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,8 @@ module.exports = {
}
};
```
### Support ES6
#### rules and syntax
To Support ES6 rules, use `tui/es6` instead.
```javascript
// .eslintrc.js
module.exports = {
'extends': 'tui/es6' // default rule and ES6 rule
};
```
#### syntax only
By default, ESLint configuration expects ES5 syntax. You can override this setting to enable support for ES6 syntax and new ES6 global variables.
```javascript
// .eslintrc.js
module.exports = {
'extends': 'tui', // no ES6 rule
'env': {
'es6': true
}
};
```

If you want to distinguish with `tui/es6`, use a version before 5.0.0

## Learn more
[JavaScript Style Guide](https://github.com/nhn/fe.javascript/wiki)
Expand Down
15 changes: 0 additions & 15 deletions es6.js

This file was deleted.

15 changes: 4 additions & 11 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
module.exports = {
extends: [
'./rules/best-practices',
'./rules/errors',
'./rules/node',
'./rules/strict',
'./rules/style',
'./rules/variables'
].map(require.resolve),
env: {
'browser': true
}
extends: ["./rules/possible", "./rules/suggestion", "./rules/layout"].map(require.resolve),
env: {
browser: true,
},
};
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "eslint-config-tui",
"version": "4.2.0",
"version": "5.0.0",
"description": "ESLint sharable config for TUI components",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"peerDependencies": {
"eslint": "^7.32.0"
"eslint": "^8.4.0"
},
"repository": {
"type": "git",
Expand Down
72 changes: 0 additions & 72 deletions rules/best-practices.js

This file was deleted.

46 changes: 0 additions & 46 deletions rules/errors.js

This file was deleted.

44 changes: 0 additions & 44 deletions rules/es6.js

This file was deleted.

88 changes: 88 additions & 0 deletions rules/layout.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
module.exports = {
rules: {
"array-bracket-newline": [2, "consistent"],
"array-bracket-spacing": [2, "never"],
"array-element-newline": 0,
"arrow-parens": [2, "as-needed"],
"arrow-spacing": [2, { before: true, after: true }],
"block-spacing": [2, "never"],
"brace-style": [2, "1tbs", { allowSingleLine: false }],
"comma-dangle": [2, "never"],
"comma-spacing": [2, { before: false, after: true }],
"comma-style": [2, "last", { exceptions: { NewExpression: false } }],
"computed-property-spacing": [2, "never", { enforceForClassMembers: true }],
"dot-location": [2, "property"],
"eol-last": 2,
"func-call-spacing": [2, "never"],
"function-call-argument-newline": 0,
"function-paren-newline": 0,
"generator-star-spacing": [2, "after"],
"implicit-arrow-linebreak": [2, "beside"],
indent: [
2,
2,
{ SwitchCase: 1, ignoreComments: false, ImportDeclaration: 1, flatTernaryExpressions: false },
],
"jsx-quotes": [2, "prefer-double"],
"key-spacing": [2, { beforeColon: false, afterColon: true }],
"keyword-spacing": 2,
"line-comment-position": 0,
"linebreak-style": [2, "unix"],
"lines-around-comment": 0,
"lines-between-class-members": [2, "always"],
"max-len": [
2,
{
code: 120,
tabWidth: 4,
ignoreStrings: true,
ignoreComments: true,
ignoreRegExpLiterals: true,
},
],
"max-statements-per-line": [2, { max: 1 }],
"multiline-ternary": 0,
"new-parens": 2,
"no-extra-parens": [2, "functions"],
"no-mixed-spaces-and-tabs": [2, "smart-tabs"],
"no-multi-spaces": 2,
"no-multiple-empty-lines": [2, { max: 1 }],
"no-tabs": 2,
"no-trailing-spaces": [2, { skipBlankLines: false, ignoreComments: true }],
"nonblock-statement-body-position": 0,
"object-curly-newline": 0,
"object-curly-spacing": [2, "never"],
"object-property-newline": [2, { allowAllPropertiesOnSameLine: false }],
"operator-linebreak": 0,
"padded-blocks": [2, "never"],
"padding-line-between-statements": [
2,
{ blankLine: "always", prev: "*", next: "return" },
{ blankLine: "always", prev: "directive", next: "*" },
{ blankLine: "any", prev: "directive", next: "directive" },
{ blankLine: "any", prev: ["const", "let", "var"], next: "*" },
{ blankLine: "always", prev: "iife", next: "*" },
{ blankLine: "always", prev: "*", next: "iife" },
],
quotes: [2, "single", { avoidEscape: true, allowTemplateLiterals: true }],
"rest-spread-spacing": [2, "never"],
semi: 2,
"semi-spacing": [2, { before: false, after: true }],
"semi-style": [2, "last"],
"space-before-blocks": 2,
"space-before-function-paren": [
2,
{ anonymous: "never", named: "never", asyncArrow: "always" },
],
"space-in-parens": [2, "never"],
"space-infix-ops": 2,
"space-unary-ops": [2, { words: true, nonwords: false }],
"switch-colon-spacing": [2, { after: true, before: false }],
"template-curly-spacing": [2, "never"],
"template-tag-spacing": [2, "never"],
"unicode-bom": [2, "never"],
"wrap-iife": [2, "inside", { functionPrototypeMethods: true }],
"wrap-regex": 0,
"yield-star-spacing": [2, "after"],
},
};
18 changes: 0 additions & 18 deletions rules/node.js

This file was deleted.

Loading

0 comments on commit 9da4add

Please sign in to comment.