@gitlab/eslint-plugin 11.0.0 → 12.1.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/.editorconfig ADDED
@@ -0,0 +1,18 @@
1
+ # top-most EditorConfig file
2
+ root = true
3
+
4
+ # Unix-style newlines with a newline ending every file
5
+ [*]
6
+ end_of_line = lf
7
+ trim_trailing_whitespace = true
8
+ insert_final_newline = true
9
+
10
+ [*.{js,json,vue,scss,rb,haml,yml}]
11
+ indent_size = 2
12
+
13
+ [*.{js,json,vue,scss,rb,haml,yml,md}]
14
+ indent_style = space
15
+ charset = utf-8
16
+
17
+ [*.{md,markdown,js.snap}]
18
+ trim_trailing_whitespace = false
package/.tool-versions ADDED
@@ -0,0 +1,2 @@
1
+ nodejs 16.14.0
2
+ yarn 1.22.17
package/CHANGELOG.md CHANGED
@@ -1,3 +1,31 @@
1
+ # [12.1.0](https://gitlab.com/gitlab-org/frontend/eslint-plugin/compare/v12.0.1...v12.1.0) (2022-04-07)
2
+
3
+
4
+ ### Features
5
+
6
+ * update eslint-plugin-vue to 8.5.0 ([37ac645](https://gitlab.com/gitlab-org/frontend/eslint-plugin/commit/37ac645f4421ce06b083625c53356e9f6c7c5679))
7
+
8
+ ## [12.0.1](https://gitlab.com/gitlab-org/frontend/eslint-plugin/compare/v12.0.0...v12.0.1) (2022-03-28)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * remove duplicate rule camelcase ([9f0523a](https://gitlab.com/gitlab-org/frontend/eslint-plugin/commit/9f0523a5cc6d0d94c8df9618e567c4a4a847287e))
14
+
15
+ # [12.0.0](https://gitlab.com/gitlab-org/frontend/eslint-plugin/compare/v11.0.0...v12.0.0) (2022-03-28)
16
+
17
+
18
+ ### Features
19
+
20
+ * migrate to @babel/eslint-parser ([cbaa880](https://gitlab.com/gitlab-org/frontend/eslint-plugin/commit/cbaa8803dfdd9295bf0334868fe0a0100806aa33))
21
+ * replace plugin-filenames with plugin-unicorn ([1e4df68](https://gitlab.com/gitlab-org/frontend/eslint-plugin/commit/1e4df689311ccdc4c46e6d9889069133a109255a))
22
+
23
+
24
+ ### BREAKING CHANGES
25
+
26
+ * - `babel/camelcase` rule is builtin in ESLint now as `camelcase`.
27
+ - The minimum required Node.js version is 14.
28
+
1
29
  # [11.0.0](https://gitlab.com/gitlab-org/frontend/eslint-plugin/compare/v10.0.2...v11.0.0) (2022-02-22)
2
30
 
3
31
 
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- [![pipeline status](https://gitlab.com/gitlab-org/frontend/eslint-plugin/badges/master/pipeline.svg)](https://gitlab.com/gitlab-org/frontend/eslint-plugin/commits/master)
1
+ [![pipeline status](https://gitlab.com/gitlab-org/frontend/eslint-plugin/badges/main/pipeline.svg)](https://gitlab.com/gitlab-org/frontend/eslint-plugin/commits/main)
2
2
  [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)
3
3
 
4
4
  # @gitlab/eslint-plugin
@@ -32,4 +32,4 @@ All the current rule tests are available in the `tests/lib/rules` directory.
32
32
 
33
33
  ### Util tests
34
34
 
35
- These utilities are useful to simplify writing new tests and can be found in the `test/lib/utils` directory.
35
+ These utilities are useful to simplify writing new tests and can be found in the `test/lib/utils` directory.
@@ -90,5 +90,5 @@ If you don't need to externalize string literals in your project.
90
90
 
91
91
  ## Further Reading
92
92
 
93
- - Code implementation of valid and invalid examples being tested: https://gitlab.com/gitlab-org/frontend/eslint-plugin/blob/master/tests/lib/rules/require-i18n-strings.js
93
+ - Code implementation of valid and invalid examples being tested: https://gitlab.com/gitlab-org/frontend/eslint-plugin/blob/main/tests/lib/rules/require-i18n-strings.js
94
94
  - Original GitLab CE issue which triggered this: https://gitlab.com/gitlab-org/gitlab-ce/issues/57970
@@ -15,19 +15,18 @@ module.exports = {
15
15
  'plugin:promise/recommended',
16
16
  ],
17
17
  parserOptions: {
18
- parser: 'babel-eslint',
18
+ parser: '@babel/eslint-parser',
19
19
  },
20
- plugins: ['babel', 'filenames', 'promise', 'import', '@gitlab'],
20
+ plugins: ['@babel', 'unicorn', 'promise', 'import', '@gitlab'],
21
21
  rules: {
22
- 'babel/camelcase': [
22
+ camelcase: [
23
23
  'error',
24
24
  {
25
25
  properties: 'never',
26
26
  ignoreDestructuring: true,
27
27
  },
28
28
  ],
29
- camelcase: 'off',
30
- 'filenames/match-regex': ['error', '^[a-z0-9_]+$'],
29
+ 'unicorn/filename-case': ['error', { case: 'snakeCase' }],
31
30
  'import/prefer-default-export': 'off',
32
31
  'import/no-default-export': 'error',
33
32
  'import/no-deprecated': 'error',
package/lib/constants.js CHANGED
@@ -1,3 +1,3 @@
1
1
  module.exports = {
2
- DOCS_BASE_URL: 'https://gitlab.com/gitlab-org/frontend/eslint-plugin/blob/master/docs/rules/',
2
+ DOCS_BASE_URL: 'https://gitlab.com/gitlab-org/frontend/eslint-plugin/blob/main/docs/rules/',
3
3
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitlab/eslint-plugin",
3
- "version": "11.0.0",
3
+ "version": "12.1.0",
4
4
  "description": "GitLab package for our custom eslint rules",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {
@@ -27,32 +27,37 @@
27
27
  },
28
28
  "homepage": "https://gitlab.com/gitlab-org/frontend/eslint-plugin#readme",
29
29
  "engines": {
30
- "node": ">=8.10.0"
30
+ "node": ">=14"
31
31
  },
32
32
  "dependencies": {
33
- "babel-eslint": "^10.0.3",
33
+ "@babel/core": "^7.17.0",
34
+ "@babel/eslint-parser": "^7.17.0",
35
+ "@babel/eslint-plugin": "^7.17.7",
34
36
  "eslint-config-airbnb-base": "^14.2.1",
35
37
  "eslint-config-prettier": "^6.10.0",
36
38
  "eslint-plugin-babel": "^5.3.0",
37
- "eslint-plugin-filenames": "^1.3.2",
38
39
  "eslint-plugin-import": "^2.22.1",
39
40
  "eslint-plugin-jest": "^23.8.2",
40
41
  "eslint-plugin-promise": "^4.2.1",
41
- "eslint-plugin-vue": "^7.5.0",
42
- "lodash": "^4.17.21",
43
- "vue-eslint-parser": "^7.0.0"
42
+ "eslint-plugin-unicorn": "^40.1.0",
43
+ "eslint-plugin-vue": "^8.5.0",
44
+ "lodash": "^4.17.21"
44
45
  },
45
46
  "peerDependencies": {
46
47
  "eslint": "^7.27.0"
47
48
  },
48
49
  "devDependencies": {
49
50
  "eslint": "^7.27.0",
50
- "glob": "^7.1.3",
51
- "jest": "^26.6.3",
52
- "prettier": "^2.2.1",
53
- "pretty-quick": "^3.1.0"
51
+ "glob": "^7.2.0",
52
+ "jest": "^27.5.1",
53
+ "prettier": "^2.6.1",
54
+ "pretty-quick": "^3.1.3",
55
+ "vue-eslint-parser": "^8.0.1"
54
56
  },
55
57
  "release": {
58
+ "branches": [
59
+ "main"
60
+ ],
56
61
  "verifyConditions": [
57
62
  "@semantic-release/changelog",
58
63
  "@semantic-release/npm",
@@ -0,0 +1,38 @@
1
+ #!/usr/bin/env bash
2
+ # Use the unofficial bash strict mode: http://redsymbol.net/articles/unofficial-bash-strict-mode/
3
+ set -euo pipefail; export FS=$'\n\t'
4
+
5
+ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
6
+ SRC_DIR="$SCRIPT_DIR/../../src"
7
+
8
+ if [ "$CI" != "true" ]; then
9
+ echo "This script is meant to run in CI"
10
+ exit 1
11
+ fi
12
+
13
+ if [ -d "$SRC_DIR" ]; then
14
+ cd "$SRC_DIR" || exit 1
15
+ REMOTE=$(git remote)
16
+ DEFAULT_BRANCH=$(git symbolic-ref "refs/remotes/${REMOTE}/HEAD" | rev | cut -d '/' -f1 | rev)
17
+ echo "src/ already exists, pulling default branch (${DEFAULT_BRANCH})"
18
+ git pull "$REMOTE" "$DEFAULT_BRANCH"
19
+ else
20
+ echo "Cloning ${TARGET_REPO} into src/"
21
+ git clone --depth 1 "${TARGET_REPO}" "$SRC_DIR";
22
+ cd "$SRC_DIR" || exit 1
23
+ fi
24
+
25
+
26
+ echo "Installing dependencies"
27
+ yarn install --frozen-lockfile
28
+
29
+ if [ -n "${CI_MERGE_REQUEST_SOURCE_BRANCH_SHA:-}" ]; then
30
+ echo "We seem to be on a Merge Request..."
31
+ SHA="$CI_MERGE_REQUEST_SOURCE_BRANCH_SHA"
32
+ else
33
+ echo "We seem to be on a branch..."
34
+ SHA="$CI_COMMIT_SHA"
35
+ fi
36
+
37
+ echo "Installing $CI_REPOSITORY_URL#$SHA"
38
+ yarn add --dev "${CI_REPOSITORY_URL}#${SHA}"