@1024pix/eslint-plugin 1.3.1 → 2.0.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.
@@ -0,0 +1,12 @@
1
+ name: Check node version availability on Scalingo
2
+
3
+ on: [push]
4
+
5
+ jobs:
6
+ check-node-compatibility:
7
+ runs-on: ubuntu-latest
8
+ steps:
9
+ - name: Checkout Repository
10
+ uses: actions/checkout@v4
11
+
12
+ - uses: 1024pix/pix-actions/check-node-version-availability-on-scalingo@v0
package/.nvmrc CHANGED
@@ -1 +1 @@
1
- 20.13.0
1
+ 20.18.1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,27 @@
1
+ # [2.0.0](https://github.com/1024pix/eslint-plugin/compare/v1.3.0...v2.0.0) (2024-12-19)
2
+
3
+ ### :boom: BREAKING CHANGE
4
+
5
+ - [#13](https://github.com/1024pix/eslint-plugin/pull/13) Montée de version d'ESLint en V9
6
+
7
+ ### :rewind: Retour en arrière
8
+
9
+ - [#33](https://github.com/1024pix/eslint-plugin/pull/33) Update dependency node to v20.17.0
10
+
11
+ ### :arrow_up: Montée de version
12
+
13
+ - [#31](https://github.com/1024pix/eslint-plugin/pull/31) Lock file maintenance
14
+ - [#43](https://github.com/1024pix/eslint-plugin/pull/43) Lock file maintenance (dossier racine)
15
+ - [#42](https://github.com/1024pix/eslint-plugin/pull/42) Lock file maintenance (dossier racine)
16
+ - [#40](https://github.com/1024pix/eslint-plugin/pull/40) Lock file maintenance (dossier racine)
17
+ - [#39](https://github.com/1024pix/eslint-plugin/pull/39) Lock file maintenance (dossier racine)
18
+ - [#37](https://github.com/1024pix/eslint-plugin/pull/37) Lock file maintenance (dossier racine)
19
+ - [#30](https://github.com/1024pix/eslint-plugin/pull/30) Update dependency node to v20.16.0
20
+ - [#34](https://github.com/1024pix/eslint-plugin/pull/34) Update dependency node to v20.17.0
21
+ - [#32](https://github.com/1024pix/eslint-plugin/pull/32) Update dependency node to v20.17.0
22
+ - [#36](https://github.com/1024pix/eslint-plugin/pull/36) Update dependency node to v20.18.0
23
+ - [#41](https://github.com/1024pix/eslint-plugin/pull/41) Update Node.js to v20.18.1
24
+
1
25
  # [1.3.0](https://github.com/1024pix/eslint-plugin/compare/v1.2.2...v1.3.0) (2024-07-16)
2
26
 
3
27
  ### :rocket: Amélioration
package/index.js CHANGED
@@ -1,6 +1,5 @@
1
- 'use strict';
2
- const noSinonStubWithArgsOneliner = require('./rules/no-sinon-stub-with-args-oneliner.js');
1
+ import noSinonStubWithArgsOneliner from './rules/no-sinon-stub-with-args-oneliner.js';
3
2
 
4
- module.exports = {
3
+ export default {
5
4
  rules: { 'no-sinon-stub-with-args-oneliner': noSinonStubWithArgsOneliner },
6
5
  };
package/package.json CHANGED
@@ -1,24 +1,30 @@
1
1
  {
2
2
  "name": "@1024pix/eslint-plugin",
3
- "version": "1.3.1",
3
+ "version": "2.0.0",
4
4
  "description": "Des règles de lint pour les projets 1024pix",
5
+ "type": "module",
6
+ "engines": {
7
+ "node": "^20 || ^22"
8
+ },
5
9
  "exports": {
6
10
  ".": "./index.js",
7
11
  "./config": "./config.js"
8
12
  },
9
13
  "scripts": {
10
- "test": "node rules/*.test.js"
14
+ "test": "ava"
11
15
  },
12
16
  "dependencies": {
13
- "@eslint-community/eslint-plugin-eslint-comments": "^4.3.0",
14
- "eslint-plugin-simple-import-sort": "^12.1.0",
15
- "eslint-plugin-yml": "^1.14.0"
17
+ "@eslint-community/eslint-plugin-eslint-comments": "^4.4.1",
18
+ "eslint-plugin-simple-import-sort": "^12.1.1",
19
+ "eslint-plugin-yml": "^1.16.0"
16
20
  },
17
21
  "devDependencies": {
18
- "eslint": "^8.57.0"
22
+ "ava": "^6.2.0",
23
+ "eslint": "^9.17.0",
24
+ "eslint-ava-rule-tester": "^5.0.1"
19
25
  },
20
26
  "peerDependencies": {
21
- "eslint": ">=8.56.0"
27
+ "eslint": ">=9.17.0"
22
28
  },
23
29
  "repository": {
24
30
  "type": "git",
package/readme.md CHANGED
@@ -7,7 +7,7 @@
7
7
  ### Install
8
8
 
9
9
  ```bash
10
- npm install --save-dev eslint@^8 @1024pix/eslint-plugin
10
+ npm install --save-dev eslint@^9 @1024pix/eslint-plugin
11
11
  ```
12
12
 
13
13
  ### Config `eslint.config.cjs`
@@ -0,0 +1,48 @@
1
+ module.exports = {
2
+ "branches": [
3
+ "main",
4
+ "dev"
5
+ ],
6
+ "plugins": [
7
+ [
8
+ "@semantic-release/commit-analyzer",
9
+ {
10
+ "config": "@1024pix/conventional-changelog-pix",
11
+ "releaseRules": [
12
+ { revert: true, release: "patch" },
13
+ { tag: "BUGFIX", pr: '*', release: "patch" },
14
+ { tag: "BUMP", pr: '*', release: "patch" },
15
+ { tag: "DOC", pr: '*', release: "patch" },
16
+ { tag: "TECH", pr: '*', release: "patch" },
17
+ { tag: "FEATURE", pr: '*', release: "minor" },
18
+ { tag: "BREAKING", pr: '*', release: "major" },
19
+ ],
20
+ }
21
+ ],
22
+ [
23
+ "@semantic-release/release-notes-generator",
24
+ {
25
+ "config": "@1024pix/conventional-changelog-pix"
26
+ }
27
+ ],
28
+ "@semantic-release/changelog",
29
+ "@semantic-release/github",
30
+ [
31
+ "@semantic-release/npm",
32
+ {
33
+ "npmPublish": process.env.NPM_PUBLISH === "true",
34
+ }
35
+ ],
36
+ [
37
+ "@semantic-release/git",
38
+ {
39
+ "assets": [
40
+ "CHANGELOG.md",
41
+ "package.json",
42
+ "package-lock.json",
43
+ ],
44
+ "message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
45
+ }
46
+ ]
47
+ ]
48
+ }
@@ -1,5 +1,3 @@
1
- 'use strict';
2
-
3
1
  function report(context, node) {
4
2
  context.report({
5
3
  node: node,
@@ -7,36 +5,32 @@ function report(context, node) {
7
5
  });
8
6
  }
9
7
 
10
- module.exports = {
8
+ export default {
11
9
  meta: {
12
10
  type: 'problem',
13
11
  docs: {
14
- description:
15
- 'Do not chain `sinon.stub()` with the `withArgs()` method in a one-liner',
12
+ description: 'Do not chain `sinon.stub()` with the `withArgs()` method in a one-liner',
16
13
  },
17
14
  messages: {
18
- chainError:
19
- '`sinon.stub()` should not be chained with the `withArgs` method.',
15
+ chainError: '`sinon.stub()` should not be chained with the `withArgs` method.',
20
16
  },
21
17
  },
22
- create: function (context) {
23
- return {
24
- 'VariableDeclarator > CallExpression > MemberExpression[property.name="returns"] > CallExpression > MemberExpression[property.name="withArgs"] > CallExpression > MemberExpression[property.name="stub"][object.name="sinon"]':
25
- function (node) {
26
- report(context, node);
27
- },
28
- 'VariableDeclarator > CallExpression > MemberExpression[property.name="throws"] > CallExpression > MemberExpression[property.name="withArgs"] > CallExpression > MemberExpression[property.name="stub"][object.name="sinon"]':
29
- function (node) {
30
- report(context, node);
31
- },
32
- 'VariableDeclarator > CallExpression > MemberExpression[property.name="resolves"] > CallExpression > MemberExpression[property.name="withArgs"] > CallExpression > MemberExpression[property.name="stub"][object.name="sinon"]':
33
- function (node) {
34
- report(context, node);
35
- },
36
- 'VariableDeclarator > CallExpression > MemberExpression[property.name="rejects"] > CallExpression > MemberExpression[property.name="withArgs"] > CallExpression > MemberExpression[property.name="stub"][object.name="sinon"]':
37
- function (node) {
38
- report(context, node);
39
- },
40
- };
41
- },
18
+ create: (context) => ({
19
+ 'VariableDeclarator > CallExpression > MemberExpression[property.name="returns"] > CallExpression > MemberExpression[property.name="withArgs"] > CallExpression > MemberExpression[property.name="stub"][object.name="sinon"]':
20
+ (node) => {
21
+ report(context, node);
22
+ },
23
+ 'VariableDeclarator > CallExpression > MemberExpression[property.name="throws"] > CallExpression > MemberExpression[property.name="withArgs"] > CallExpression > MemberExpression[property.name="stub"][object.name="sinon"]':
24
+ (node) => {
25
+ report(context, node);
26
+ },
27
+ 'VariableDeclarator > CallExpression > MemberExpression[property.name="resolves"] > CallExpression > MemberExpression[property.name="withArgs"] > CallExpression > MemberExpression[property.name="stub"][object.name="sinon"]':
28
+ (node) => {
29
+ report(context, node);
30
+ },
31
+ 'VariableDeclarator > CallExpression > MemberExpression[property.name="rejects"] > CallExpression > MemberExpression[property.name="withArgs"] > CallExpression > MemberExpression[property.name="stub"][object.name="sinon"]':
32
+ (node) => {
33
+ report(context, node);
34
+ },
35
+ }),
42
36
  };
@@ -1,11 +1,9 @@
1
- 'use strict';
1
+ import test from 'ava';
2
+ import AvaRuleTester from 'eslint-ava-rule-tester';
2
3
 
3
- const rule = require('./no-sinon-stub-with-args-oneliner.js'),
4
- RuleTester = require('eslint').RuleTester;
4
+ import rule from './no-sinon-stub-with-args-oneliner.js';
5
5
 
6
- const ruleTester = new RuleTester({
7
- parserOptions: { ecmaVersion: 2015, sourceType: 'module' },
8
- });
6
+ const ruleTester = new AvaRuleTester(test);
9
7
 
10
8
  ruleTester.run('no-sinon-stub-with-args-oneliner', rule, {
11
9
  valid: [
@@ -1,12 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <module type="WEB_MODULE" version="4">
3
- <component name="NewModuleRootManager">
4
- <content url="file://$MODULE_DIR$">
5
- <excludeFolder url="file://$MODULE_DIR$/.tmp" />
6
- <excludeFolder url="file://$MODULE_DIR$/temp" />
7
- <excludeFolder url="file://$MODULE_DIR$/tmp" />
8
- </content>
9
- <orderEntry type="inheritedJdk" />
10
- <orderEntry type="sourceFolder" forTests="false" />
11
- </component>
12
- </module>
@@ -1,6 +0,0 @@
1
- <component name="InspectionProjectProfileManager">
2
- <profile version="1.0">
3
- <option name="myName" value="Project Default" />
4
- <inspection_tool class="Eslint" enabled="true" level="WARNING" enabled_by_default="true" />
5
- </profile>
6
- </component>
package/.idea/modules.xml DELETED
@@ -1,8 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="ProjectModuleManager">
4
- <modules>
5
- <module fileurl="file://$PROJECT_DIR$/.idea/eslint-plugin.iml" filepath="$PROJECT_DIR$/.idea/eslint-plugin.iml" />
6
- </modules>
7
- </component>
8
- </project>
package/.idea/vcs.xml DELETED
@@ -1,6 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="VcsDirectoryMappings">
4
- <mapping directory="" vcs="Git" />
5
- </component>
6
- </project>