@wistia/eslint-config 0.3.2 → 0.3.3

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.
@@ -15,7 +15,7 @@ module.exports = {
15
15
  'jest/no-duplicate-hooks': 'error',
16
16
  'jest/no-export': 'error',
17
17
  'jest/no-focused-tests': 'error',
18
- // hooks may arguably promote shared state but they're handy
18
+ // hooks are useful even though they *potentially* promote shared state between tests
19
19
  'jest/no-hooks': 'off',
20
20
  'jest/no-identical-title': 'error',
21
21
  'jest/no-if': 'error',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wistia/eslint-config",
3
- "version": "0.3.2",
3
+ "version": "0.3.3",
4
4
  "description": "Wistia's ESLint configurations",
5
5
  "main": "react.js",
6
6
  "scripts": {
@@ -34,7 +34,8 @@
34
34
  "stylelint-config-standard-scss": "^3.0.0",
35
35
  "stylelint-declaration-block-no-ignored-properties": "^2.5.0",
36
36
  "stylelint-prettier": "^2.0.0",
37
- "stylelint-processor-styled-components": "^1.10.0"
37
+ "stylelint-processor-styled-components": "^1.10.0",
38
+ "stylelint-scss": "^4.2.0"
38
39
  },
39
40
  "devDependencies": {
40
41
  "@commitlint/cli": "^16.2.3",
@@ -42,7 +43,7 @@
42
43
  "husky": "^7.0.4"
43
44
  },
44
45
  "engines": {
45
- "node": "^10.12.0 || >=12.0.0"
46
+ "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
46
47
  },
47
48
  "repository": {
48
49
  "type": "git",
@@ -0,0 +1,11 @@
1
+ const commonRules = require('../stylelintRules/common');
2
+ const scssRules = require('../stylelintRules/scss');
3
+
4
+ module.exports = {
5
+ plugins: ['stylelint-prettier', 'stylelint-scss'],
6
+ extends: ['stylelint-config-standard-scss'], // see: https://github.com/stylelint-scss/stylelint-config-standard-scss/blob/main/index.js
7
+ rules: {
8
+ ...commonRules,
9
+ ...scssRules,
10
+ },
11
+ };
@@ -0,0 +1,33 @@
1
+ // only add rules pertaining to scss
2
+
3
+ module.exports = {
4
+ // disallow vendor prefixes
5
+ 'at-rule-no-vendor-prefix': true,
6
+ 'property-no-vendor-prefix': true,
7
+ 'selector-no-vendor-prefix': true,
8
+ 'value-no-vendor-prefix': true,
9
+
10
+ // prefer single to double quotes for better js compat
11
+ 'string-quotes': 'single',
12
+
13
+ // *** DISABLED RULES ***
14
+ // too many violations to fix so we just allow any pattern
15
+ 'selector-class-pattern': '[a-zA-Z0-9]',
16
+ 'selector-id-pattern': '[a-zA-Z0-9]',
17
+
18
+ // unfortunately these conflict with sass functions; hopefully someday we will be able to enable
19
+ 'color-function-notation': null,
20
+ 'alpha-value-notation': null,
21
+
22
+ // thousands of these errors, not realistically fixable
23
+ 'no-descending-specificity': null,
24
+
25
+ // TODO: should try to fix these, there's not too many
26
+ 'no-duplicate-selectors': null,
27
+
28
+ 'scss/at-extend-no-missing-placeholder': null,
29
+ 'scss/at-mixin-pattern': null,
30
+ 'scss/dollar-variable-pattern': null,
31
+ 'scss/no-global-function-names': null,
32
+ 'scss/percent-placeholder-pattern': null,
33
+ };
package/.commitlintrc.js DELETED
@@ -1,3 +0,0 @@
1
- module.exports = {
2
- extends: ['@commitlint/config-conventional'],
3
- };
package/.eslintrc.js DELETED
@@ -1,16 +0,0 @@
1
- module.exports = {
2
- root: true,
3
- env: {
4
- es6: true,
5
- },
6
- parser: '@babel/eslint-parser',
7
- parserOptions: {
8
- requireConfigFile: false,
9
- },
10
- extends: ['prettier'],
11
- plugins: ['prettier'],
12
- rules: {
13
- // prettier configuration
14
- 'prettier/prettier': 'error',
15
- },
16
- };
@@ -1,23 +0,0 @@
1
- name: Commitlint
2
-
3
- on: pull_request
4
-
5
- jobs:
6
- run-commitlint:
7
- name: Run commitlint
8
- runs-on: ubuntu-20.04
9
- timeout-minutes: 5
10
-
11
- steps:
12
- - name: Check out Git respository
13
- uses: actions/checkout@v2.3.4
14
- with:
15
- # by default this only fetches the latest commit,
16
- # but more commits are needed to validate a range of commit messages
17
- fetch-depth: 0
18
-
19
- - name: Validate commit messages
20
- uses: wagoid/commitlint-github-action@v4
21
- with:
22
- configFile: .commitlintrc.js
23
- helpURL: https://github.com/conventional-changelog/commitlint/#what-is-commitlint
@@ -1,41 +0,0 @@
1
- name: Lint
2
-
3
- on: pull_request
4
-
5
- env:
6
- NODE_VERSION: 16.10.0
7
-
8
- jobs:
9
- run-linters:
10
- name: Run linters
11
- runs-on: ubuntu-20.04
12
- timeout-minutes: 5
13
-
14
- steps:
15
- - name: Set up Node.js environment
16
- uses: actions/setup-node@v2.4.1
17
- with:
18
- node-version: ${{ env.NODE_VERSION }}
19
-
20
- - name: Check out Git respository
21
- uses: actions/checkout@v2.3.4
22
-
23
- - name: Cache node_modules
24
- uses: actions/cache@v2.1.6
25
- id: cache-modules
26
- with:
27
- path: '**/node_modules'
28
- key: ${{ runner.os }}-node${{ env.NODE_VERSION }}-${{ hashFiles('**/yarn.lock') }}
29
- restore-keys: |
30
- ${{ runner.os }}-node${{ env.NODE_VERSION }}-
31
-
32
- - name: Install Node.js dependencies
33
- if: steps.cache-modules.outputs.cache-hit != 'true'
34
- run: yarn --frozen-lockfile
35
-
36
- - name: Run eslint & stylelint
37
- uses: wearerequired/lint-action@v1.10.0
38
- with:
39
- github_token: ${{ secrets.github_token }}
40
- eslint: true
41
- eslint_extensions: js
package/.husky/commit-msg DELETED
@@ -1,4 +0,0 @@
1
- #!/bin/sh
2
- . "$(dirname "$0")/_/husky.sh"
3
-
4
- yarn commitlint --edit $1
package/.prettierrc.js DELETED
@@ -1,5 +0,0 @@
1
- module.exports = {
2
- printWidth: 100,
3
- singleQuote: true,
4
- trailingComma: 'all',
5
- };
package/.tool-versions DELETED
@@ -1,3 +0,0 @@
1
- ruby 2.7.5
2
- nodejs 16.10.0
3
- yarn 1.22.10
package/catalog-info.yaml DELETED
@@ -1,17 +0,0 @@
1
- # this is a catalog entity descriptor file for our Backstage instance (https://backstage.wistia.cloud)
2
-
3
- apiVersion: backstage.io/v1alpha1
4
- kind: Component
5
- metadata:
6
- name: ESLint-Config
7
- description: Wistia's ESLint configurations
8
- annotations:
9
- github.com/project-slug: wistia/eslint-config
10
- backstage.io/techdocs-ref: dir:.
11
- tags:
12
- - lang#javascript
13
- - pkg#npm
14
- spec:
15
- type: configuration
16
- owner: app-platform
17
- lifecycle: production
package/mkdocs.yaml DELETED
@@ -1,10 +0,0 @@
1
- # this file exists to generate techdocs for Backstage (https://backstage.wistia.cloud)
2
-
3
- site_name: ESLint-Config
4
- docs_dir: .
5
- plugins:
6
- - techdocs-core
7
- - same-dir
8
- - exclude:
9
- glob:
10
- - node_modules/*