Skip to content
This repository has been archived by the owner on Nov 8, 2019. It is now read-only.

Commit

Permalink
Update eslint plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick Hwang committed Dec 16, 2015
1 parent 492cab8 commit 9b21d5f
Show file tree
Hide file tree
Showing 9 changed files with 112 additions and 58 deletions.
63 changes: 63 additions & 0 deletions packages/eslint-config-hubspot/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
2.1.1 / 2015-12-15
==================
- [fix] Remove deprecated react/jsx-quotes (#622)

2.1.0 / 2015-12-15
==================
- [fix] use `require.resolve` to allow nested `extend`s (#582)
- [new] enable `object-shorthand` rule (#621)
- [new] enable `arrow-spacing` rule (#517)
- [docs] flesh out react rule defaults (#618)

2.0.0 / 2015-12-03
==================
- [breaking] `space-before-function-paren`: require function spacing: `function <optional name>(` (#605)
- [breaking] `indent`: Fix switch statement indentation rule (#606)
- [breaking] `array-bracket-spacing`, `computed-property-spacing`: disallow spacing inside brackets (#594)
- [breaking] `object-curly-spacing`: require padding inside curly braces (#594)
- [breaking] `space-in-parens`: disallow spaces in parens (#594)

1.0.2 / 2015-11-25
==================
- [breaking] `no-multiple-empty-lines`: only allow 1 blank line at EOF (#578)
- [new] `restParams`: enable rest params (#592)

1.0.1 / 2015-11-25
==================
- *erroneous publish*

1.0.0 / 2015-11-08
==================
- require `eslint` `v1.0.0` or higher
- remove `babel-eslint` dependency

0.1.1 / 2015-11-05
==================
- remove id-length rule (#569)
- enable `no-mixed-spaces-and-tabs` (#539)
- enable `no-const-assign` (#560)
- enable `space-before-keywords` (#554)

0.1.0 / 2015-11-05
==================
- switch to modular rules files courtesy the [eslint-config-default][ecd] project and [@taion][taion]. [PR][pr-modular]
- export `eslint-config-airbnb/legacy` for ES5-only users. `eslint-config-airbnb/legacy` does not require the `babel-eslint` parser. [PR][pr-legacy]

0.0.9 / 2015-09-24
==================
- add rule `no-undef`
- add rule `id-length`

0.0.8 / 2015-08-21
==================
- now has a changelog
- now is modular (see instructions above for with react and without react versions)

0.0.7 / 2015-07-30
==================
- TODO: fill in

[ecd]: https://github.com/walmartlabs/eslint-config-defaults
[taion]: https://github.com/taion
[pr-modular]: https://github.com/airbnb/javascript/pull/526
[pr-legacy]: https://github.com/airbnb/javascript/pull/527
42 changes: 0 additions & 42 deletions packages/eslint-config-hubspot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,45 +46,3 @@ programming to structure our README as test cases for our .eslintrc?
You can run tests with `npm test`.

You can make sure this module lints with itself using `npm run lint`.

## Changelog

### 1.0.2
- enable rest params in linter, derp. (#592)
- enforce rule 18.5, ensuring files end with a single newline character. (#578)

### 1.0.1

oops

### 1.0.0
- require `eslint` `v1.0.0` or higher
- removes `babel-eslint` dependency

### 0.1.1
- remove id-length rule (#569)
- enable `no-mixed-spaces-and-tabs` (#539)
- enable `no-const-assign` (#560)
- enable `space-before-keywords` (#554)

### 0.1.0

- switch to modular rules files courtesy the [eslint-config-default][ecd]
project and [@taion][taion]. [PR][pr-modular]
- export `eslint-config-airbnb/legacy` for ES5-only users.
`eslint-config-airbnb/legacy` does not require the `babel-eslint` parser.
[PR][pr-legacy]

[ecd]: https://github.com/walmartlabs/eslint-config-defaults
[taion]: https://github.com/taion
[pr-modular]: https://github.com/airbnb/javascript/pull/526
[pr-legacy]: https://github.com/airbnb/javascript/pull/527

### 0.0.9

- add rule no-undef
- add rule id-length

### 0.0.8
- now has a changelog
- now is modular (see instructions above for with react and without react versions)
2 changes: 1 addition & 1 deletion packages/eslint-config-hubspot/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ module.exports = {
extends: [
'eslint-config-hubspot/legacy',
'eslint-config-hubspot/rules/es6',
],
].map(require.resolve),
rules: {}
};
2 changes: 1 addition & 1 deletion packages/eslint-config-hubspot/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ module.exports = {
extends: [
'eslint-config-hubspot/base',
'eslint-config-hubspot/rules/react',
],
].map(require.resolve),
rules: {}
};
2 changes: 1 addition & 1 deletion packages/eslint-config-hubspot/legacy.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module.exports = {
'eslint-config-hubspot/rules/strict',
'eslint-config-hubspot/rules/style',
'eslint-config-hubspot/rules/variables'
],
].map(require.resolve),
env: {
browser: true,
node: true,
Expand Down
6 changes: 3 additions & 3 deletions packages/eslint-config-hubspot/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eslint-config-hubspot",
"version": "1.0.7",
"version": "2.0.0",
"description": "HubSpot's ESLint config, following our styleguide",
"main": "index.js",
"scripts": {
Expand Down Expand Up @@ -32,8 +32,8 @@
"homepage": "https://github.com/HubSpot/javascript",
"devDependencies": {
"babel-tape-runner": "1.2.0",
"eslint": "^1.10.2",
"eslint-plugin-react": "^3.11.1",
"eslint": "^1.10.3",
"eslint-plugin-react": "^3.11.3",
"faucet": "0.0.1",
"react": "^0.13.3",
"tape": "^4.2.2"
Expand Down
6 changes: 4 additions & 2 deletions packages/eslint-config-hubspot/rules/es6.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ module.exports = {
// require parens in arrow function arguments
'arrow-parens': 0,
// require space before/after arrow function's arrow
'arrow-spacing': 0,
// https://github.com/eslint/eslint/blob/master/docs/rules/arrow-spacing.md
'arrow-spacing': [2, { 'before': true, 'after': true }],
// verify super() callings in constructors
'constructor-super': 0,
// enforce the spacing around the * in generator functions
Expand All @@ -40,7 +41,8 @@ module.exports = {
// require let or const instead of var
'no-var': 2,
// require method and property shorthand syntax for object literals
'object-shorthand': 0,
// https://github.com/eslint/eslint/blob/master/docs/rules/object-shorthand.md
'object-shorthand': [2, 'always'],
// suggest using of const declaration for variables that are never modified after declared
'prefer-const': 2,
// suggest using the spread operator instead of .apply()
Expand Down
36 changes: 32 additions & 4 deletions packages/eslint-config-hubspot/rules/react.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,44 +7,67 @@ module.exports = {
},
'rules': {
// Prevent missing displayName in a React component definition
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/display-name.md
'react/display-name': 0,
// Enforce boolean attributes notation in JSX
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-boolean-value.md
'react/jsx-boolean-value': [2, 'always'],
// Validate closing bracket location in JSX
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-closing-bracket-location.md
'react/jsx-closing-bracket-location': [2, {'selfClosing': 'tag-aligned', 'nonEmpty': 'after-props'}],
// Enforce or disallow spaces inside of curly braces in JSX attributes
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-curly-spacing.md
'react/jsx-curly-spacing': 0,
// Validate props indentation in JSX
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-indent-props.md
'react/jsx-indent-props': [2, 2],
// Prevent duplicate props in JSX
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-duplicate-props.md
'react/jsx-no-duplicate-props': 0,
// Disallow undeclared variables in JSX
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-undef.md
'react/jsx-no-undef': 2,
// Enforce quote style for JSX attributes
'react/jsx-quotes': 0,
// Enforce propTypes declarations alphabetical sorting
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-sort-prop-types.md
'react/jsx-sort-prop-types': 0,
// Enforce props alphabetical sorting
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-sort-props.md
'react/jsx-sort-props': 0,
// Prevent React to be incorrectly marked as unused
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-uses-react.md
'react/jsx-uses-react': 2,
// Prevent variables used in JSX to be incorrectly marked as unused
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-uses-vars.md
'react/jsx-uses-vars': 2,
// Prevent usage of dangerous JSX properties
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-danger.md
'react/no-danger': 0,
// Prevent usage of setState in componentDidMount
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-did-mount-set-state.md
'react/no-did-mount-set-state': [2, 'allow-in-func'],
// Prevent usage of setState in componentDidUpdate
'react/no-did-update-set-state': 2,
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-did-update-set-state.md
'react/no-did-update-set-state': [2, 'allow-in-func'],
// Prevent multiple component definition per file
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-multi-comp.md
'react/no-multi-comp': 2,
// Prevent usage of unknown DOM property
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-unknown-property.md
'react/no-unknown-property': 2,
// Prevent missing props validation in a React component definition
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/prop-types.md
'react/prop-types': 2,
// Prevent missing React when using JSX
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/react-in-jsx-scope.md
'react/react-in-jsx-scope': 2,
// Restrict file extensions that may be required
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/require-extension.md
'react/require-extension': 0,
// Prevent extra closing tags for components without children
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/self-closing-comp.md
'react/self-closing-comp': 2,
// Enforce component methods order
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/sort-comp.md
'react/sort-comp': [2, {
'order': [
'lifecycle',
Expand Down Expand Up @@ -75,6 +98,11 @@ module.exports = {
}
}],
// Prevent missing parentheses around multilines JSX
'react/wrap-multilines': 2
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/wrap-multilines.md
'react/wrap-multilines': [2, {
declaration: true,
assignment: true,
return: true
}]
}
};
11 changes: 7 additions & 4 deletions packages/eslint-config-hubspot/rules/style.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module.exports = {
'rules': {
// enforce spacing inside array brackets
'array-bracket-spacing': 0,
'array-bracket-spacing': [2, 'never'],
// enforce one true brace style
'brace-style': [2, '1tbs', {'allowSingleLine': true }],
// require camel case names
Expand All @@ -11,7 +11,7 @@ module.exports = {
// enforce one true comma style
'comma-style': [2, 'last'],
// require or disallow padding inside computed properties
'computed-property-spacing': 0,
'computed-property-spacing': [2, 'never'],
// enforces consistent naming when capturing the current execution context
'consistent-this': 0,
// enforce newline at the end of file, with no multiple empty lines
Expand All @@ -23,8 +23,10 @@ module.exports = {
// this option enforces minimum and maximum identifier lengths (variable names, property names etc.)
'id-length': 0,
// this option sets a specific tab width for your code
'indent': [2, 2],
// https://github.com/eslint/eslint/blob/master/docs/rules/indent.md
'indent': [2, 2, { 'SwitchCase': 1, 'VariableDeclarator': 1 }],
// specify whether double or single quotes should be used in JSX attributes
// http://eslint.org/docs/rules/jsx-quotes
'jsx-quotes': [2, 'prefer-double'],
// enforces spacing between keys and values in object literal properties
'key-spacing': [2, {'beforeColon': false, 'afterColon': true}],
Expand Down Expand Up @@ -95,9 +97,10 @@ module.exports = {
// require or disallow space before blocks
'space-before-blocks': 2,
// require or disallow space before function opening parenthesis
// https://github.com/eslint/eslint/blob/master/docs/rules/space-before-function-paren.md
'space-before-function-paren': [2, 'never'],
// require or disallow spaces inside parentheses
'space-in-parens': 0,
'space-in-parens': [2, 'never'],
// require spaces around operators
'space-infix-ops': 2,
// require a space after return, throw, and case
Expand Down

0 comments on commit 9b21d5f

Please sign in to comment.