Skip to content

Commit 0aa77d1

Browse files
Moved "eslint-config-modular" to the @jsdevtools scope
1 parent 5623ce8 commit 0aa77d1

21 files changed

+88
-88
lines changed

.eslintrc.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
extends:
2-
- modular/best-practices
3-
- modular/style
4-
- modular/es6
5-
- modular/node
2+
- "@jsdevtools/modular/best-practices"
3+
- "@jsdevtools/modular/style"
4+
- "@jsdevtools/modular/es6"
5+
- "@jsdevtools/modular/node"

.github/workflows/CI-CD.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
- name: Link eslint-config-modular, so ESLint can find it
4747
run: |
4848
npm link
49-
npm link eslint-config-modular
49+
npm link @jsdevtools/eslint-config-modular
5050
5151
- name: Run linter
5252
run: npm run lint

README.md

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ Modular ESLint Configuration
77
[![Coverage Status](https://coveralls.io/repos/github/JS-DevTools/eslint-config-modular/badge.svg?branch=master)](https://coveralls.io/github/JS-DevTools/eslint-config-modular)
88
[![Dependencies](https://david-dm.org/JS-DevTools/eslint-config-modular/dev-status.svg)](https://david-dm.org/JS-DevTools/eslint-config-modular?type=dev)
99

10-
[![npm](https://img.shields.io/npm/v/eslint-config-modular.svg?maxAge=43200)](https://www.npmjs.com/package/eslint-config-modular)
11-
[![License](https://img.shields.io/npm/l/eslint-config-modular.svg?maxAge=2592000)](LICENSE)
10+
[![npm](https://img.shields.io/npm/v/@jsdevtools/eslint-config-modular.svg?maxAge=43200)](https://www.npmjs.com/package/@jsdevtools/eslint-config-modular)
11+
[![License](https://img.shields.io/npm/l/@jsdevtools/eslint-config-modular.svg?maxAge=2592000)](LICENSE)
1212

1313
ESLint Modular is a [shareable config](https://eslint.org/docs/developer-guide/shareable-configs) for [ESLint](https://eslint.org/) that's broken-up into different modules that can be mixed-and-matched to match the needs of your project.
1414

@@ -28,7 +28,7 @@ Installation
2828
Run the following [npm](https://docs.npmjs.com/about-npm/) command to install [ESLint](https://eslint.org/) and ESLint Modular as dev-dependencies of your project:
2929

3030
```bash
31-
npm install eslint eslint-config-modular --save-dev
31+
npm install eslint @jsdevtools/eslint-config-modular --save-dev
3232
```
3333

3434

@@ -44,10 +44,10 @@ To use ESLint Modular in your project, create an `.eslintrc.yml` file with the f
4444
```yaml
4545
extends:
4646
# These modules would be good for a Node.js project written in ES5
47-
- modular/best-practices
48-
- modular/style
49-
- modular/node
50-
- modular/es5
47+
- "@jsdevtools/modular/best-practices"
48+
- "@jsdevtools/modular/style"
49+
- "@jsdevtools/modular/node"
50+
- "@jsdevtools/modular/es5"
5151

5252
rules:
5353
# You can override or extend any rules here
@@ -57,54 +57,54 @@ rules:
5757

5858
Modules
5959
-----------------------
60-
`eslint-config-modular` includes the following modules. Mix-and-match them as applicable to your project.
60+
Modular ESLint Configuration includes the following modules. Mix-and-match them as applicable to your project.
6161

62-
### `modular/best-practices` <small>[(source)](./best-practices/index.js)</small>
62+
### `@jsdevtools/modular/best-practices` <small>[(source)](./best-practices/index.js)</small>
6363
This module contains rules that prevent accidental bugs, insecure code, and bad coding practices. You can use this module directly, or use any/all of its sub-modules.
6464

65-
#### `modular/best-practices/bugs` <small>[(source)](./best-practices/bugs.js)</small>
65+
#### `@jsdevtools/modular/best-practices/bugs` <small>[(source)](./best-practices/bugs.js)</small>
6666
The rules in this module prevent syntax that is likely to lead to accidental bugs or runtime errors. Examples include not [reassigning native objects](https://eslint.org/docs/rules/no-native-reassign), and [using `===` instead of `==`](https://eslint.org/docs/rules/eqeqeq) for comparisons. Most of the rules in this file will raise an error if violated, but some less-severe ones will only raise warnings.
6767

68-
#### `modular/best-practices/security` <small>[(source)](./best-practices/security.js)</small>
68+
#### `@jsdevtools/modular/best-practices/security` <small>[(source)](./best-practices/security.js)</small>
6969
These rules help enforce security best-practices such as [avoiding the `eval()` statement](https://eslint.org/docs/rules/no-eval) and requiring [`"use strict"` directives](https://eslint.org/docs/rules/strict).
7070

71-
### `modular/browser` <small>[(source)](./browser/index.js)</small>
71+
### `@jsdevtools/modular/browser` <small>[(source)](./browser/index.js)</small>
7272
This module configures ESLint to recognize browser globals, such as `window`, `document`, `navigator`, etc. It also contains rules that are specific to projects that are intended to run in web browsers, such as [avoiding the `alert()` statement](https://eslint.org/docs/rules/no-alert) and [requiring the `use strict` directive within a function](http://www.ecma-international.org/ecma-262/6.0/#sec-directive-prologues-and-the-use-strict-directive).
7373

74-
### `modular/browser/jsx` <small>[(source)](./browser/jsx.js)</small>
74+
### `@jsdevtools/modular/browser/jsx` <small>[(source)](./browser/jsx.js)</small>
7575
This module configures ESLint to parse [JSX syntax](https://facebook.github.io/react/docs/jsx-in-depth.html). It also contains JSX-specific rules, such as enforcing the use of [double-quotes in JSX attributes](https://eslint.org/docs/rules/jsx-quotes).
7676

77-
### `modular/es5` <small>[(source)](./es5/index.js)</small>
77+
### `@jsdevtools/modular/es5` <small>[(source)](./es5/index.js)</small>
7878
This module configures ESLint to parse EcmaScript 5 code. It also disables ES6-specific rules, such as [using `let` instead of `var`](https://eslint.org/docs/rules/no-var).
7979

80-
### `modular/es6` <small>[(source)](./es6/index.js)</small>
80+
### `@jsdevtools/modular/es6` <small>[(source)](./es6/index.js)</small>
8181
This module configures ESLint to parse EcmaScript 6 (and newer) code. It also contains ES6-specific rules, such as [not assigning to constants](https://eslint.org/docs/rules/no-const-assign), [calling `super()` in constructors](https://eslint.org/docs/rules/no-this-before-super), and [using `let` instead of `var`](https://eslint.org/docs/rules/no-var).
8282

83-
### `modular/modules/cjs` <small>[(source)](./modules/cjs.js)</small>
83+
### `@jsdevtools/modular/modules/cjs` <small>[(source)](./modules/cjs.js)</small>
8484
This module configures ESLint to parse your JavaScript files with [script semantics](http://www.ecma-international.org/ecma-262/6.0/#sec-scripts-static-semantics-early-errors) rather than [ES6 module semantics](http://www.ecma-international.org/ecma-262/6.0/#sec-module-semantics), since CommonJS modules are not "true" JavaScript modules.
8585

86-
### `modular/modules/esm` <small>[(source)](./modules/esm.js)</small>
86+
### `@jsdevtools/modular/modules/esm` <small>[(source)](./modules/esm.js)</small>
8787
This module configures ESLint to parse your JavaScript files with [ES6 module semantics](http://www.ecma-international.org/ecma-262/6.0/#sec-module-semantics) rather than [script semantics](http://www.ecma-international.org/ecma-262/6.0/#sec-scripts-static-semantics-early-errors). It also disallows [the `use strict` directive](http://www.ecma-international.org/ecma-262/6.0/#sec-directive-prologues-and-the-use-strict-directive), since ES6 modules are always strict.
8888

89-
### `modular/node` <small>[(source)](./node/index.js)</small>
89+
### `@jsdevtools/modular/node` <small>[(source)](./node/index.js)</small>
9090
This module configures ESLint to recognize Node.js globals, such as `process`, `__dirname`, `Buffer`, etc. It also contains rules that are specific to Node.js projects, such as [avoding `new require()` syntax](https://eslint.org/docs/rules/no-new-require) and [disallowing concatenation with `__dirname`](https://eslint.org/docs/rules/no-path-concat).
9191

92-
### `modular/style` <small>[(source)](./style/index.js)</small>
92+
### `@jsdevtools/modular/style` <small>[(source)](./style/index.js)</small>
9393
This module contains code-styling and consistency rules. You can use this module directly, or use any/all of its sub-modules.
9494

95-
#### `modular/style/conventions` <small>[(source)](./style/conventions.js)</small>
95+
#### `@jsdevtools/modular/style/conventions` <small>[(source)](./style/conventions.js)</small>
9696
The rules in this module enforce an **opinionated** set of conventions, such as using [double-quotes](https://eslint.org/docs/rules/quotes) and [semi-colons](https://eslint.org/docs/rules/semi).
9797

98-
#### `modular/style/naming` <small>[(source)](./style/naming.js)</small>
98+
#### `@jsdevtools/modular/style/naming` <small>[(source)](./style/naming.js)</small>
9999
These rules enforce JavaScript naming conventions, such as [camel-case variables](https://eslint.org/docs/rules/camelcase) and [capitialized classes](https://eslint.org/docs/rules/new-cap).
100100

101-
#### `modular/style/syntax` <small>[(source)](./style/syntax.js)</small>
101+
#### `@jsdevtools/modular/style/syntax` <small>[(source)](./style/syntax.js)</small>
102102
These rules disallow outdated, nonstandard, and confusing syntax. Examples include [labels](https://eslint.org/docs/rules/no-labels), [the comma operator](https://eslint.org/docs/rules/no-sequences), and [nonstandard multiline strings](https://eslint.org/docs/rules/no-multi-str).
103103

104-
#### `modular/style/whitespace` <small>[(source)](./style/whitespace.js)</small>
104+
#### `@jsdevtools/modular/style/whitespace` <small>[(source)](./style/whitespace.js)</small>
105105
This module enforces **opinionated** whitespace rules, such as [two-space indentation](https://eslint.org/docs/rules/indent), [Stroustrup style opening braces](https://eslint.org/docs/rules/brace-style), and [commas at the end of the line](https://eslint.org/docs/rules/comma-style).
106106

107-
### `modular/test` <small>[(source)](./test/index.js)</small>
107+
### `@jsdevtools/modular/test` <small>[(source)](./test/index.js)</small>
108108
This module configures ESLint to recognize globals that are defined by common test frameworks, such as `describe`, `it`, `beforeEach`, etc. It also disables rules that tend to cause problems with certain test frameworks.
109109

110110
> **Note:** We recommend that you create a separate `.eslintrc.yml` file in your test folder. That way, it can use different modules and rules than the rest of your codebase.

best-practices/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
module.exports = {
44
extends: [
5-
"modular/best-practices/bugs",
6-
"modular/best-practices/security",
5+
"@jsdevtools/modular/best-practices/bugs",
6+
"@jsdevtools/modular/best-practices/security",
77
],
88
};

index.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
module.exports = {
44
extends: [
5-
"modular/best-practices",
6-
"modular/style",
7-
"modular/browser",
8-
"modular/node",
9-
"modular/es5",
5+
"@jsdevtools/modular/best-practices",
6+
"@jsdevtools/modular/style",
7+
"@jsdevtools/modular/browser",
8+
"@jsdevtools/modular/node",
9+
"@jsdevtools/modular/es5",
1010
],
1111
};

node/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"use strict";
22

33
module.exports = {
4-
extends: "modular/modules/cjs",
4+
extends: "@jsdevtools/modular/modules/cjs",
55

66
env: {
77
node: true,

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "eslint-config-modular",
2+
"name": "@jsdevtools/eslint-config-modular",
33
"version": "7.0.2",
44
"description": "Modular ESLint configuration",
55
"keywords": [

style/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
module.exports = {
44
extends: [
5-
"modular/style/conventions",
6-
"modular/style/naming",
7-
"modular/style/syntax",
8-
"modular/style/whitespace",
5+
"@jsdevtools/modular/style/conventions",
6+
"@jsdevtools/modular/style/naming",
7+
"@jsdevtools/modular/style/syntax",
8+
"@jsdevtools/modular/style/whitespace",
99
],
1010
};

test/.eslintrc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
extends:
2-
- modular/test
2+
- "@jsdevtools/modular/test"

test/specs/best-practices.spec.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,25 @@ chai.should();
66

77
describe("best-practices", function () {
88
it("should not be enforced if module is not used", function () {
9-
let results = ESLint.run("modular/browser", "5 == 4");
9+
let results = ESLint.run("@jsdevtools/modular/browser", "5 == 4");
1010
results.errorCount.should.equal(0);
1111
});
1212

1313
it("should require strict equality comparisons", function () {
14-
let results = ESLint.run("modular/best-practices", "5 == 4");
14+
let results = ESLint.run("@jsdevtools/modular/best-practices", "5 == 4");
1515
results.errorCount.should.equal(2);
1616
results.rules.should.deep.equal(["no-unused-expressions", "eqeqeq"]);
1717
});
1818

1919
it('should require the "use strict" pragma at the function level by default', function () {
20-
let results = ESLint.run("modular/best-practices", "function foo () {} foo();");
20+
let results = ESLint.run("@jsdevtools/modular/best-practices", "function foo () {} foo();");
2121
results.errorCount.should.equal(1);
2222
results.rules.should.deep.equal(["strict"]);
2323
results.messages[0].message.should.equal("Use the function form of 'use strict'.");
2424
});
2525

2626
it('should require the "use strict" pragma at the global level for CommonJS', function () {
27-
let results = ESLint.run(["modular/best-practices", "modular/modules/cjs"], "function foo () {} foo();");
27+
let results = ESLint.run(["@jsdevtools/modular/best-practices", "@jsdevtools/modular/modules/cjs"], "function foo () {} foo();");
2828
results.errorCount.should.equal(1);
2929
results.rules.should.deep.equal(["strict"]);
3030
results.messages[0].message.should.equal("Use the global form of 'use strict'.");

test/specs/browser.spec.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,32 +6,32 @@ chai.should();
66

77
describe("browser", function () {
88
it("should not be enforced if module is not used", function () {
9-
let results = ESLint.run("modular/style", 'alert("hello, world");\n');
9+
let results = ESLint.run("@jsdevtools/modular/style", 'alert("hello, world");\n');
1010
results.errorCount.should.equal(0);
1111
});
1212

1313
it("should warn about `alert()` statements", function () {
14-
let results = ESLint.run("modular/browser", 'alert("hello, world")');
14+
let results = ESLint.run("@jsdevtools/modular/browser", 'alert("hello, world")');
1515
results.warningCount.should.equal(1);
1616
results.rules.should.deep.equal(["no-alert"]);
1717
});
1818

1919
it('should require the "use strict" pragma at the function level', function () {
20-
let results = ESLint.run("modular/browser", "function foo () {} foo();");
20+
let results = ESLint.run("@jsdevtools/modular/browser", "function foo () {} foo();");
2121
results.errorCount.should.equal(1);
2222
results.rules.should.deep.equal(["strict"]);
2323
results.messages[0].message.should.equal("Use the function form of 'use strict'.");
2424
});
2525

2626
it('should require the "use strict" pragma at the global level if the CommonJS module is loaded after', function () {
27-
let results = ESLint.run(["modular/browser", "modular/modules/cjs"], "function foo () {} foo();");
27+
let results = ESLint.run(["@jsdevtools/modular/browser", "@jsdevtools/modular/modules/cjs"], "function foo () {} foo();");
2828
results.errorCount.should.equal(1);
2929
results.rules.should.deep.equal(["strict"]);
3030
results.messages[0].message.should.equal("Use the global form of 'use strict'.");
3131
});
3232

3333
it('should not allow the "use strict" pragma at the global level', function () {
34-
let results = ESLint.run("modular/browser", '"use strict"; function foo () {} foo();');
34+
let results = ESLint.run("@jsdevtools/modular/browser", '"use strict"; function foo () {} foo();');
3535
results.errorCount.should.equal(2);
3636
results.rules.should.deep.equal(["strict", "strict"]);
3737
results.messages[0].message.should.equal("Use the function form of 'use strict'.");

test/specs/es5.spec.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,19 @@ chai.should();
66

77
describe("es5", function () {
88
it("should not be enforced if module is not used", function () {
9-
let results = ESLint.run("modular/browser", "var foo = 5;");
9+
let results = ESLint.run("@jsdevtools/modular/browser", "var foo = 5;");
1010
results.errorCount.should.equal(0);
1111
});
1212

1313
it("should not allow ES6 module syntax", function () {
14-
let results = ESLint.run("modular/es5", "import foo from 'bar';");
14+
let results = ESLint.run("@jsdevtools/modular/es5", "import foo from 'bar';");
1515
results.errorCount.should.equal(1);
1616
results.messages.should.have.lengthOf(1);
1717
results.messages[0].message.should.equal("Parsing error: The keyword 'import' is reserved");
1818
});
1919

2020
it("should not allow ES6 syntax", function () {
21-
let results = ESLint.run("modular/es5", "const foo = 'bar';");
21+
let results = ESLint.run("@jsdevtools/modular/es5", "const foo = 'bar';");
2222
results.errorCount.should.equal(1);
2323
results.messages.should.have.lengthOf(1);
2424
results.messages[0].message.should.equal("Parsing error: The keyword 'const' is reserved");

test/specs/es6.spec.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,28 @@ chai.should();
66

77
describe("es6", function () {
88
it("should not be enforced if module is not used", function () {
9-
let results = ESLint.run("modular/browser",
9+
let results = ESLint.run("@jsdevtools/modular/browser",
1010
"var foo = 5;\n" +
1111
"var bar = { foo: foo };"
1212
);
1313
results.errorCount.should.equal(0);
1414
});
1515

1616
it('should not allow ES6 module syntax unless the "modules/esm" module is also used', function () {
17-
let results = ESLint.run("modular/es6", "import foo from 'bar';");
17+
let results = ESLint.run("@jsdevtools/modular/es6", "import foo from 'bar';");
1818
results.errorCount.should.equal(1);
1919
results.messages.should.have.lengthOf(1);
2020
results.messages[0].message.should.equal("Parsing error: 'import' and 'export' may appear only with 'sourceType: module'");
2121
});
2222

2323
it("should not allow the `var` keyword", function () {
24-
let results = ESLint.run("modular/es6", 'var foo = "bar";');
24+
let results = ESLint.run("@jsdevtools/modular/es6", 'var foo = "bar";');
2525
results.errorCount.should.equal(1);
2626
results.rules.should.deep.equal(["no-var"]);
2727
});
2828

2929
it("should suggest object shorthand notation", function () {
30-
let results = ESLint.run("modular/es6",
30+
let results = ESLint.run("@jsdevtools/modular/es6",
3131
'const foo = "foo";\n' +
3232
"let bar = { foo: foo };"
3333
);

test/specs/eslint.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ describe("ESLint", function () {
88
// This test just verifies that ESLint runs without errors,
99
// which means that all of our modules are syntactically valid
1010
it("should run without errors", function () {
11-
let results = ESLint.run("modular",
11+
let results = ESLint.run("@jsdevtools/modular",
1212
'"use strict";\n' +
1313
"var foo = 1;\n" +
1414
"bar(foo);\n" +
@@ -22,7 +22,7 @@ describe("ESLint", function () {
2222

2323
// This test just verifies that ESLint correctly loaded our modules
2424
it("should report errors for rule violations", function () {
25-
let results = ESLint.run("modular", "var foo = 'hello, world'");
25+
let results = ESLint.run("@jsdevtools/modular", "var foo = 'hello, world'");
2626

2727
results.rules.should.deep.equal([
2828
"strict", "no-unused-vars", "quotes", "eol-last", "semi"

test/specs/jsx.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ chai.should();
66

77
describe("jsx", function () {
88
it("should not be enforced if module is not used", function () {
9-
let results = ESLint.run("modular/node",
9+
let results = ESLint.run("@jsdevtools/modular/node",
1010
"var foo = <div className='some-class'>hello, world</div>;"
1111
);
1212
results.errorCount.should.equal(1);
1313
results.messages[0].message.should.equal("Parsing error: Unexpected token <");
1414
});
1515

1616
it("should require double quotes for JSX attributes", function () {
17-
let results = ESLint.run(["modular/es6", "modular/browser/jsx"],
17+
let results = ESLint.run(["@jsdevtools/modular/es6", "@jsdevtools/modular/browser/jsx"],
1818
"let foo = <div className='some-class'>hello, world</div>;"
1919
);
2020
results.errorCount.should.equal(1);

0 commit comments

Comments
 (0)