@wistia/eslint-config 0.2.3 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.tool-versions ADDED
@@ -0,0 +1,3 @@
1
+ ruby 2.7.5
2
+ nodejs 16.10.0
3
+ yarn 1.22.10
@@ -32,6 +32,15 @@ module.exports = {
32
32
  ],
33
33
  // adjust to allow render props
34
34
  'react/no-unstable-nested-components': ['error', { allowAsProps: true }],
35
+ // airbnb config for this rule is not compatible with the vast majority of
36
+ // our existing code, so instead of refactoring everything we just adjust this rule
37
+ 'react/function-component-definition': [
38
+ 'error',
39
+ {
40
+ namedComponents: 'arrow-function',
41
+ unnamedComponents: 'arrow-function',
42
+ },
43
+ ],
35
44
  // these two rules are no longer required with React 17 & babel `automatic` runtime
36
45
  'react/jsx-uses-react': 'off',
37
46
  'react/react-in-jsx-scope': 'off',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wistia/eslint-config",
3
- "version": "0.2.3",
3
+ "version": "0.3.0",
4
4
  "description": "Wistia's ESLint configurations",
5
5
  "main": "react.js",
6
6
  "scripts": {
@@ -16,8 +16,8 @@
16
16
  "eslint-config-prettier": "^8.3.0",
17
17
  "eslint-plugin-better-styled-components": "^1.1.2",
18
18
  "eslint-plugin-import": "^2.25.3",
19
- "eslint-plugin-jest": "^25.2.4",
20
- "eslint-plugin-jest-dom": "^3.9.2",
19
+ "eslint-plugin-jest": "^26.0.0",
20
+ "eslint-plugin-jest-dom": "^4.0.1",
21
21
  "eslint-plugin-jest-formatting": "^3.0.0",
22
22
  "eslint-plugin-jsx-a11y": "^6.5.1",
23
23
  "eslint-plugin-prettier": "^4.0.0",
@@ -26,16 +26,17 @@
26
26
  "eslint-plugin-styled-components-a11y": "^0.0.34",
27
27
  "eslint-plugin-testing-library": "^5.0.0",
28
28
  "prettier": "^2.4.1",
29
- "stylelint": "^13.0.0",
29
+ "stylelint": "^14.0.0",
30
30
  "stylelint-config-prettier": "^9.0.0",
31
- "stylelint-config-standard": "^22.0.0",
32
- "stylelint-declaration-block-no-ignored-properties": "^2.0.0",
33
- "stylelint-prettier": "^1.0.0",
31
+ "stylelint-config-standard": "^24.0.0",
32
+ "stylelint-config-styled-components": "^0.1.1",
33
+ "stylelint-declaration-block-no-ignored-properties": "^2.3.0",
34
+ "stylelint-prettier": "^2.0.0",
34
35
  "stylelint-processor-styled-components": "^1.10.0"
35
36
  },
36
37
  "devDependencies": {
37
- "@commitlint/cli": "^14.1.0",
38
- "@commitlint/config-conventional": "^14.1.0",
38
+ "@commitlint/cli": "^16.0.1",
39
+ "@commitlint/config-conventional": "^16.0.0",
39
40
  "husky": "^7.0.1"
40
41
  },
41
42
  "engines": {
@@ -4,7 +4,11 @@ const styledComponentRules = require('../stylelintRules/styled-components');
4
4
  module.exports = {
5
5
  plugins: ['stylelint-prettier', 'stylelint-declaration-block-no-ignored-properties'],
6
6
  processors: ['stylelint-processor-styled-components'],
7
- extends: ['stylelint-config-standard', 'stylelint-config-prettier'],
7
+ extends: [
8
+ 'stylelint-config-standard',
9
+ 'stylelint-config-styled-components',
10
+ 'stylelint-config-prettier',
11
+ ],
8
12
  rules: {
9
13
  ...commonRules,
10
14
  ...styledComponentRules,
@@ -1,10 +1,18 @@
1
1
  // only add rules pertaining to styled-components
2
2
 
3
3
  module.exports = {
4
+ // in css-in-js when variables are being passed around, this rule
5
+ // often leads to less readable code, even though it is more compact
6
+ 'declaration-block-no-redundant-longhand-properties': null,
7
+ // this appears to conflict with styled-components keyframes method
8
+ 'keyframes-name-pattern': null,
4
9
  // without this pretty much every file will throw an error¯\_(ツ)_/¯
5
10
  'no-empty-source': null,
6
11
  // disallow property values that are ignored due to another property value in the same rule
7
12
  'plugin/declaration-block-no-ignored-properties': true,
13
+ // prevent snake case from being used for class/id selectors but be otherwise flexible
14
+ 'selector-class-pattern': '^[a-zA-Z0-9-]+(-[a-zA-Z0-9]+)*$',
15
+ 'selector-id-pattern': '^[a-zA-Z0-9-]+(-[a-zA-Z0-9]+)*$',
8
16
  // these selectors are used as placeholders by styled-components preprocessor
9
17
  'selector-type-no-unknown': [true, { ignoreTypes: ['$dummyValue', '/^-styled-/'] }],
10
18
  'value-keyword-case': [