Skip to content

Commit 3afb3d7

Browse files
Moved "tslint-modular" to the @jsdevtools scope
1 parent 96648bf commit 3afb3d7

13 files changed

+71
-71
lines changed

.github/workflows/CI-CD.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
- name: Link tslint-modular, so TSLint can find it
4747
run: |
4848
npm link
49-
npm link tslint-modular
49+
npm link @jsdevtools/tslint-modular
5050
5151
- name: Run linter
5252
run: npm run lint

README.md

+23-23
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Modular TSLint Configuration
2-
=======================
2+
===============================
33

44
[![Cross-Platform Compatibility](https://jstools.dev/img/badges/os-badges.svg)](https://github.com/JS-DevTools/tslint-modular/blob/master/.github/workflows/CI-CD.yaml)
55
[![Build Status](https://github.com/JS-DevTools/tslint-modular/workflows/CI-CD/badge.svg)](https://github.com/JS-DevTools/tslint-modular/blob/master/.github/workflows/CI-CD.yaml)
@@ -10,7 +10,7 @@ Modular TSLint Configuration
1010
[![npm](https://img.shields.io/npm/v/tslint-modular.svg?maxAge=43200)](https://www.npmjs.com/package/tslint-modular)
1111
[![License](https://img.shields.io/npm/l/tslint-modular.svg?maxAge=2592000)](LICENSE)
1212

13-
`tslint-modular` is a set of [configuration presets](https://palantir.github.io/tslint/usage/configuration/#configuration-presets) for [TSLint](https://palantir.github.io/tslint/) that's broken-up into different modules that can be mixed-and-matched to match the needs of your project.
13+
TSLint Modular is a set of [configuration presets](https://palantir.github.io/tslint/usage/configuration/#configuration-presets) for [TSLint](https://palantir.github.io/tslint/) that's broken-up into different modules that can be mixed-and-matched to match the needs of your project.
1414

1515
Each module defines rules that are meant to be reasonable defaults and best practices, but you can easily extend or override any of the rules to suit your needs.
1616

@@ -24,10 +24,10 @@ Related Projects
2424

2525
Installation
2626
-----------------------
27-
Run the following [npm](https://docs.npmjs.com/about-npm/) command to install [TSLint](https://palantir.github.io/tslint/) and `tslint-modular` as dev-dependencies of your project:
27+
Run the following [npm](https://docs.npmjs.com/about-npm/) command to install [TSLint](https://palantir.github.io/tslint/) and `@jsdevtools/tslint-modular` as dev-dependencies of your project:
2828

2929
```bash
30-
npm install tslint tslint-modular --save-dev
30+
npm install tslint @jsdevtools/tslint-modular --save-dev
3131
```
3232

3333

@@ -37,16 +37,16 @@ Usage
3737
Configuration presets are designed to work with the `extends` feature of `tslint.yaml` files. You can learn more about
3838
[configuration presets](https://palantir.github.io/tslint/usage/configuration/#configuration-presets) on the official TSLint website.
3939

40-
To use `tslint-modular` in your project, create a `tslint.yaml` file with the following contents:
40+
To use TSLint Modular in your project, create a `tslint.yaml` file with the following contents:
4141

4242
**tslint.yaml**
4343
```yaml
4444
extends:
4545
# These modules would be good for a library that runs in Node.js and web browsers
46-
- tslint-modular/best-practices
47-
- tslint-modular/style
48-
- tslint-modular/node
49-
- tslint-modular/browser
46+
- "@jsdevtools/tslint-modular/best-practices"
47+
- "@jsdevtools/tslint-modular/style"
48+
- "@jsdevtools/tslint-modular/node"
49+
- "@jsdevtools/tslint-modular/browser"
5050

5151
rules:
5252
# You can override or extend the rules here
@@ -56,45 +56,45 @@ rules:
5656

5757
Modules
5858
-----------------------
59-
`tslint-modular` includes the following modules. Mix-and-match them as applicable to your project.
59+
TSLint Modular includes the following modules. Mix-and-match them as applicable to your project.
6060

61-
### `tslint-modular/best-practices` <small>[(source)](./best-practices/index.js)</small>
61+
### `@jsdevtools/tslint-modular/best-practices` <small>[(source)](./best-practices/index.js)</small>
6262
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.
6363

64-
#### `tslint-modular/best-practices/bugs` <small>[(source)](./best-practices/bugs.js)</small>
64+
#### `@jsdevtools/tslint-modular/best-practices/bugs` <small>[(source)](./best-practices/bugs.js)</small>
6565
Prevents syntax that is likely to lead to accidental bugs or runtime errors. Examples include not [duplicate variables](https://palantir.github.io/tslint/rules/no-duplicate-variable/), and [using `===` instead of `==`](https://palantir.github.io/tslint/rules/triple-equals) for comparisons. Most of the rules in this file will raise an error if violated, but some less-severe ones will only raise warnings.
6666

67-
#### `tslint-modular/best-practices/maintainability` <small>[(source)](./best-practices/maintainability.js)</small>
67+
#### `@jsdevtools/tslint-modular/best-practices/maintainability` <small>[(source)](./best-practices/maintainability.js)</small>
6868
Helps you write code that is more maintainable over time and by multiple people. For example, [limiting cyclomatic complexity](https://palantir.github.io/tslint/rules/cyclomatic-complexity) and [keeping files short](https://palantir.github.io/tslint/rules/max-file-line-count).
6969

70-
#### `tslint-modular/best-practices/security` <small>[(source)](./best-practices/security.js)</small>
70+
#### `@jsdevtools/tslint-modular/best-practices/security` <small>[(source)](./best-practices/security.js)</small>
7171
Helps enforce security best-practices such as [avoiding the `eval()` statement](https://palantir.github.io/tslint/rules/no-eval) and [not calling the `Function` constructor](https://palantir.github.io/tslint/rules/function-constructor).
7272

73-
### `tslint-modular/browser` <small>[(source)](./browser/index.js)</small>
73+
### `@jsdevtools/tslint-modular/browser` <small>[(source)](./browser/index.js)</small>
7474
Bans bad practices for web-based code, such as [the `alert()` statement](https://eslint.org/docs/rules/no-alert#disallow-use-of-alert-no-alert) and the jQuery global.
7575

76-
### `tslint-modular/node` <small>[(source)](./node/index.js)</small>
76+
### `@jsdevtools/tslint-modular/node` <small>[(source)](./node/index.js)</small>
7777
Discourages deprecated and outdated Node.js code, such as [`fs.exists()`](https://nodejs.org/api/fs.html#fs_fs_exists_path_callback). It encourages using more modern syntax, such as [the `fs.promises` API](https://nodejs.org/api/fs.html#fs_fs_promises_api).
7878

79-
### `tslint-modular/style` <small>[(source)](./style/index.js)</small>
79+
### `@jsdevtools/tslint-modular/style` <small>[(source)](./style/index.js)</small>
8080
Contains code-styling and consistency rules. You can use this module directly, or use any/all of its sub-modules.
8181

82-
#### `tslint-modular/style/comments` <small>[(source)](./style/comments.js)</small>
82+
#### `@jsdevtools/tslint-modular/style/comments` <small>[(source)](./style/comments.js)</small>
8383
Code-commenting rules, such as [documenting all public members](https://palantir.github.io/tslint/rules/completed-docs/), using [JSDoc format](https://palantir.github.io/tslint/rules/jsdoc-format/), and not [duplicating type information](https://palantir.github.io/tslint/rules/no-redundant-jsdoc/) in comments.
8484

85-
#### `tslint-modular/style/conventions` <small>[(source)](./style/conventions.js)</small>
85+
#### `@jsdevtools/tslint-modular/style/conventions` <small>[(source)](./style/conventions.js)</small>
8686
Enforces an **opinionated** set of conventions, such as using [double-quotes](https://palantir.github.io/tslint/rules/quotemark/) and [semi-colons](https://palantir.github.io/tslint/rules/semicolon).
8787

88-
#### `tslint-modular/style/naming` <small>[(source)](./style/naming.js)</small>
88+
#### `@jsdevtools/tslint-modular/style/naming` <small>[(source)](./style/naming.js)</small>
8989
Encourages good JavaScript naming conventions, such as [camel-case variables](https://palantir.github.io/tslint/rules/variable-name) and [capitialized classes](https://palantir.github.io/tslint/rules/class-name).
9090

91-
#### `tslint-modular/style/syntax` <small>[(source)](./style/syntax.js)</small>
91+
#### `@jsdevtools/tslint-modular/style/syntax` <small>[(source)](./style/syntax.js)</small>
9292
Disallows outdated, nonstandard, and confusing syntax. Examples include [labels](https://palantir.github.io/tslint/rules/label-position), [the comma operator](https://palantir.github.io/tslint/rules/ban-comma-operator), and [parameter properties](https://palantir.github.io/tslint/rules/no-parameter-properties).
9393

94-
#### `tslint-modular/style/whitespace` <small>[(source)](./style/whitespace.js)</small>
94+
#### `@jsdevtools/tslint-modular/style/whitespace` <small>[(source)](./style/whitespace.js)</small>
9595
Enforces **opinionated** whitespace rules, such as [two-space indentation](https://palantir.github.io/tslint/rules/indent), [opening braces on the same line](https://palantir.github.io/tslint/rules/one-line), and [type definition spacing](https://palantir.github.io/tslint/rules/typedef-whitespace).
9696

97-
### `tslint-modular/test` <small>[(source)](./test/index.js)</small>
97+
### `@jsdevtools/tslint-modular/test` <small>[(source)](./test/index.js)</small>
9898
Warns about `describe.only()` and `it.only()` calls that may have accidentally been left in your test code.
9999

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

best-practices/index.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

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

index.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

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

package-lock.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "tslint-modular",
2+
"name": "@jsdevtools/tslint-modular",
33
"version": "1.6.1",
44
"description": "Modular TSLint configuration",
55
"keywords": [

style/index.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

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

test/specs/best-practices.spec.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,20 @@ const TSLint = require("../utils/tslint");
44
const chai = require("chai");
55
chai.should();
66

7-
describe("tslint-modular/best-practices", () => {
7+
describe("@jsdevtools/tslint-modular/best-practices", () => {
88
it("should not be enforced if module is not used", () => {
99
let results = TSLint.run(
10-
"tslint-modular/browser",
10+
"@jsdevtools/tslint-modular/browser",
1111
"Date.now() == Date.now();"
1212
);
1313

1414
results.errors.should.deep.equal([]);
1515
results.warnings.should.deep.equal([]);
1616
});
1717

18-
it("should include tslint-modular/best-practices/bugs", () => {
18+
it("should include @jsdevtools/tslint-modular/best-practices/bugs", () => {
1919
let results = TSLint.run(
20-
"tslint-modular/best-practices",
20+
"@jsdevtools/tslint-modular/best-practices",
2121
`
2222
Date.now() == Date.now();
2323
interface Foo {}
@@ -36,9 +36,9 @@ describe("tslint-modular/best-practices", () => {
3636
results.warnings.should.deep.equal([]);
3737
});
3838

39-
it("should include tslint-modular/best-practices/maintainability", () => {
39+
it("should include best-practices/maintainability", () => {
4040
let results = TSLint.run(
41-
"tslint-modular/best-practices",
41+
"@jsdevtools/tslint-modular/best-practices",
4242
`
4343
import { readFile } from "fs";
4444
import { writeFile } from "fs";
@@ -68,9 +68,9 @@ describe("tslint-modular/best-practices", () => {
6868
results.warnings.should.deep.equal([]);
6969
});
7070

71-
it("should include tslint-modular/best-practices/security", () => {
71+
it("should include best-practices/security", () => {
7272
let results = TSLint.run(
73-
"tslint-modular/best-practices",
73+
"@jsdevtools/tslint-modular/best-practices",
7474
`
7575
eval("x = 5");
7676
let x = Function("x = 5");

test/specs/browser.spec.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ const TSLint = require("../utils/tslint");
44
const chai = require("chai");
55
chai.should();
66

7-
describe("tslint-modular/browser", () => {
7+
describe("@jsdevtools/tslint-modular/browser", () => {
88
it("should not be enforced if module is not used", () => {
99
let results = TSLint.run(
10-
"tslint-modular/node",
10+
"@jsdevtools/tslint-modular/node",
1111
`
1212
var name = window.prompt("What's your name?");
1313
alert("hello, " + name);
@@ -20,7 +20,7 @@ describe("tslint-modular/browser", () => {
2020

2121
it("should warn about alert(), confirm(), and prompt()", () => {
2222
let results = TSLint.run(
23-
"tslint-modular/browser",
23+
"@jsdevtools/tslint-modular/browser",
2424
`
2525
var answer = window.prompt("What's your name?");
2626
if (confirm("Are you sure it's " + answer)) {

test/specs/node.spec.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ const TSLint = require("../utils/tslint");
44
const chai = require("chai");
55
chai.should();
66

7-
describe("tslint-modular/node", () => {
7+
describe("@jsdevtools/tslint-modular/node", () => {
88
it("should not be enforced if module is not used", () => {
99
let results = TSLint.run(
10-
"tslint-modular/browser",
10+
"@jsdevtools/tslint-modular/browser",
1111
`
1212
const fs = require("fs");
1313
const file = "some-file.txt";
@@ -30,7 +30,7 @@ describe("tslint-modular/node", () => {
3030

3131
it("should warn about fs.exists() and callback versions of fs functions", () => {
3232
let results = TSLint.run(
33-
"tslint-modular/node",
33+
"@jsdevtools/tslint-modular/node",
3434
`
3535
const fs = require("fs");
3636
const file = "some-file.txt";

test/specs/style.spec.js

+12-12
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ const TSLint = require("../utils/tslint");
44
const chai = require("chai");
55
chai.should();
66

7-
describe("tslint-modular/style", () => {
7+
describe("@jsdevtools/tslint-modular/style", () => {
88
it("should not be enforced if module is not used", () => {
99
let results = TSLint.run(
10-
"tslint-modular/best-practices",
10+
"@jsdevtools/tslint-modular/best-practices",
1111
`
1212
/**Does a thing
1313
* and returns a value */
@@ -24,9 +24,9 @@ describe("tslint-modular/style", () => {
2424
results.warnings.should.deep.equal([]);
2525
});
2626

27-
it("should include tslint-modular/style/comments", () => {
27+
it("should include style/comments", () => {
2828
let results = TSLint.run(
29-
"tslint-modular/style",
29+
"@jsdevtools/tslint-modular/style",
3030
`
3131
/**Does a thing
3232
* and returns a value
@@ -48,9 +48,9 @@ describe("tslint-modular/style", () => {
4848
results.warnings.should.deep.equal([]);
4949
});
5050

51-
it("should include tslint-modular/style/conventions", () => {
51+
it("should include style/conventions", () => {
5252
let results = TSLint.run(
53-
"tslint-modular/style",
53+
"@jsdevtools/tslint-modular/style",
5454
`
5555
function foo(x: string[][], y: number = 5): Array<string> {
5656
return x[0].sort(a => { return y });
@@ -86,9 +86,9 @@ describe("tslint-modular/style", () => {
8686
results.warnings.should.deep.equal([]);
8787
});
8888

89-
it("should include tslint-modular/style/naming", () => {
89+
it("should include style/naming", () => {
9090
let results = TSLint.run(
91-
"tslint-modular/style",
91+
"@jsdevtools/tslint-modular/style",
9292
`
9393
interface IClass {
9494
name: string;
@@ -116,9 +116,9 @@ describe("tslint-modular/style", () => {
116116
results.warnings.should.deep.equal([]);
117117
});
118118

119-
it("should include tslint-modular/style/syntax", () => {
119+
it("should include style/syntax", () => {
120120
let results = TSLint.run(
121-
"tslint-modular/style",
121+
"@jsdevtools/tslint-modular/style",
122122
`
123123
/// <reference path="fs" />
124124
import fs from "fs";
@@ -156,9 +156,9 @@ describe("tslint-modular/style", () => {
156156
]);
157157
});
158158

159-
it("should include tslint-modular/style/whitespace", () => {
159+
it("should include style/whitespace", () => {
160160
let results = TSLint.run(
161-
"tslint-modular/style",
161+
"@jsdevtools/tslint-modular/style",
162162
`
163163
import{readFile}from "fs";
164164

test/specs/test.spec.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ const TSLint = require("../utils/tslint");
44
const chai = require("chai");
55
chai.should();
66

7-
describe("tslint-modular/test", () => {
7+
describe("@jsdevtools/tslint-modular/test", () => {
88
it("should not be enforced if module is not used", () => {
99
let results = TSLint.run(
10-
"tslint-modular",
10+
"@jsdevtools/tslint-modular",
1111
`
1212
describe.only("My test suite", () => {
1313
it.only("My test", () => {
@@ -23,7 +23,7 @@ describe("tslint-modular/test", () => {
2323

2424
it("should warn about describe.only() and it.only()", () => {
2525
let results = TSLint.run(
26-
"tslint-modular/test",
26+
"@jsdevtools/tslint-modular/test",
2727
`
2828
describe.only("My test suite", () => {
2929
it.only("My test", () => {

test/specs/tslint.spec.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ const TSLint = require("../utils/tslint");
44
const chai = require("chai");
55
chai.should();
66

7-
describe("tslint-modular", () => {
7+
describe("@jsdevtools/tslint-modular", () => {
88
/**
99
* This test just verifies that TSLint runs without errors,
1010
* which means that all of our modules are syntactically valid
1111
*/
1212
it("should run without errors", () => {
1313
let results = TSLint.run(
14-
"tslint-modular",
14+
"@jsdevtools/tslint-modular",
1515
`
1616
/**
1717
* My Class
@@ -39,7 +39,7 @@ describe("tslint-modular", () => {
3939
*/
4040
it("should report errors for rule violations", () => {
4141
let results = TSLint.run(
42-
"tslint-modular",
42+
"@jsdevtools/tslint-modular",
4343
`
4444
export default class my_class {
4545
method1 (x) {}
@@ -82,7 +82,7 @@ describe("tslint-modular", () => {
8282
*/
8383
it("should include all TSLint rules", () => {
8484
let allRules = Object.keys(require("tslint/lib/configs/all").rules);
85-
let ourRules = getRulesRecursive("tslint-modular");
85+
let ourRules = getRulesRecursive("@jsdevtools/tslint-modular");
8686

8787
for (let rule of allRules) {
8888
ourRules.should.contain(rule);

0 commit comments

Comments
 (0)