@moccu/eslint-config 0.2.3 โ†’ 0.5.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.
@@ -1,11 +1,18 @@
1
- # To get started with Dependabot version updates, you'll need to specify which
2
- # package ecosystems to update and where the package manifests are located.
3
- # Please see the documentation for all configuration options:
4
- # https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5
-
6
1
  version: 2
7
2
  updates:
8
- - package-ecosystem: "npm" # See documentation for possible values
9
- directory: "/" # Location of package manifests
3
+ - package-ecosystem: 'npm'
4
+ directory: '/'
5
+ schedule:
6
+ interval: 'monthly'
7
+ time: '05:00'
8
+ groups:
9
+ dependencies:
10
+ update-types:
11
+ - 'minor'
12
+ - 'patch'
13
+
14
+ - package-ecosystem: 'github-actions'
15
+ directory: '/'
10
16
  schedule:
11
- interval: "weekly"
17
+ interval: 'monthly'
18
+ time: '05:00'
@@ -5,12 +5,33 @@ jobs:
5
5
  build:
6
6
  runs-on: ubuntu-latest
7
7
  steps:
8
- - name: Checkout
9
- uses: actions/checkout@v2
8
+ - name: Checkout ๐Ÿ›Ž๏ธ
9
+ uses: actions/checkout@v4
10
10
  with:
11
11
  persist-credentials: false
12
12
 
13
- - name: Build
13
+ - name: Setup ๐Ÿ”Œ
14
+ uses: actions/setup-node@v4
15
+ with:
16
+ node-version-file: '.nvmrc'
17
+ registry-url: https://registry.npmjs.org/
18
+
19
+ - name: Install dependencies ๐Ÿ‘จ๐Ÿปโ€๐Ÿ’ป
20
+ run: npm ci
21
+
22
+ - name: Run tests ๐Ÿงช
23
+ run: npm t
24
+
25
+ - name: Publish ๐Ÿš€
26
+ if: startsWith(github.ref, 'refs/tags/')
27
+ run: npm publish --access public
28
+ env:
29
+ NODE_AUTH_TOKEN: ${{secrets.NODE_AUTH_TOKEN}}
30
+
31
+ - name: Publish to GitHub ๐Ÿš€
32
+ if: startsWith(github.ref, 'refs/tags/')
14
33
  run: |
15
- npm ci
16
- npm test
34
+ npm set //npm.pkg.github.com/:_authToken $GITHUB_TOKEN
35
+ npm publish --access public --@moccu:registry=https://npm.pkg.github.com
36
+ env:
37
+ GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
package/.nvmrc CHANGED
@@ -1 +1 @@
1
- 14.16.1
1
+ 20.15.0
package/package.json CHANGED
@@ -1,13 +1,10 @@
1
1
  {
2
2
  "name": "@moccu/eslint-config",
3
3
  "description": "The eslint config we use at moccu",
4
- "version": "0.2.3",
4
+ "version": "0.5.0",
5
5
  "author": "Moccu GmbH & Co. KG",
6
6
  "license": "MIT",
7
7
  "repository": "moccu/eslint-config-moccu",
8
- "engines": {
9
- "node": ">=6"
10
- },
11
8
  "scripts": {
12
9
  "test": "node test/index.js"
13
10
  },
@@ -33,15 +30,12 @@
33
30
  "hint"
34
31
  ],
35
32
  "devDependencies": {
36
- "chalk": "^4.1.1",
37
- "deepmerge": "^4.2.2",
38
- "eslint": "^5.12.1",
39
- "eslint-plugin-react": "^7.12.4",
40
- "eslint-plugin-sort-class-members": "^1.4.0"
33
+ "eslint": "^8.35.0",
34
+ "eslint-plugin-react": "^7.32.2",
35
+ "eslint-plugin-sort-class-members": "^1.20.0"
41
36
  },
42
37
  "peerDependencies": {
43
- "eslint": ">=5.12.1",
44
- "eslint-plugin-react": ">=7.12.4",
45
- "eslint-plugin-sort-class-members": "^1.4.0"
38
+ "eslint": ">=8.0.0",
39
+ "eslint-plugin-sort-class-members": "^1.20.0"
46
40
  }
47
41
  }
package/test/core.js CHANGED
@@ -1,33 +1,51 @@
1
1
  'use strict';
2
2
 
3
+ (async function() {
4
+ const
5
+ assert = require('assert'),
6
+ {ESLint} = require('eslint'),
7
+ files = ['**/*.js'],
8
+ configs = ['index', 'react', 'react-proptypes']
9
+ ;
3
10
 
4
- const
5
- assert = require('assert'),
6
- chalk = require('chalk'),
7
- deepmerge = require('deepmerge'),
8
- eslint = require('eslint'),
9
- files = ['**/*.js'],
10
- config = ['index', 'react', 'react-proptypes'].reduce(
11
- (cfg, name) => deepmerge(cfg, require('../' + name)),
12
- {
13
- useEslintrc: false,
14
- envs: ['node', 'es6']
15
- }),
16
- report = new eslint.CLIEngine(config).executeOnFiles(files);
17
- ;
11
+ let
12
+ errorCount = 0,
13
+ warningCount = 0
14
+ ;
18
15
 
16
+ await Promise.all(configs.map(async (name) => {
17
+ const
18
+ config = require(`../${name}`),
19
+ eslint = new ESLint({
20
+ useEslintrc: false,
21
+ overrideConfig: {
22
+ env: {
23
+ 'es6': true,
24
+ 'node': true
25
+ },
26
+ parserOptions: {
27
+ 'ecmaVersion': 'latest'
28
+ },
29
+ ...config
30
+ }
31
+ }),
32
+ results = await eslint.lintFiles(files)
33
+ ;
19
34
 
20
- // Show error report
21
- eslint.CLIEngine.getErrorResults(report.results).forEach((error) =>
22
- error.messages.forEach((message) =>
23
- console.error(
24
- chalk.red(message.message),
25
- chalk.white(`(${message.ruleId})`),
26
- chalk.white(`\n\t${error.filePath}:${message.line}:${message.column}`)
27
- )
28
- )
29
- );
35
+ // Show error report
36
+ ESLint.getErrorResults(results).forEach((error) => {
37
+ errorCount += error.errorCount;
38
+ warningCount += error.warningCount;
39
+ error.messages.length && console.log('\n', error.filePath);
40
+ error.messages.forEach((message) => console.log(`${message.line}:${message.column}`, message.message, message.ruleId));
41
+ error.messages.length && console.log(`\n${error.errorCount} errors, ${error.warningCount} warnings\n`);
42
+ });
43
+ }));
30
44
 
31
- // Self test
32
- assert.equal(report.errorCount, 0);
33
- assert.equal(report.warningCount, 0);
45
+ // Self test
46
+ assert.equal(errorCount, 0);
47
+ assert.equal(warningCount, 0);
48
+ })().catch((error) => {
49
+ process.exitCode = 1;
50
+ console.error(error);
51
+ });