-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #141 from bmish/require-cjs
More robust loading of CJS plugins using `require()`
- Loading branch information
Showing
28 changed files
with
502 additions
and
436 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# eslint-plugin-test | ||
|
||
## Rules | ||
|
||
<!-- begin auto-generated rules list --> | ||
|
||
💼 Configurations enabled in.\ | ||
✅ Set in the `recommended` configuration. | ||
|
||
| Name | Description | 💼 | | ||
| :----------------------------- | :--------------------- | :- | | ||
| [no-bar](docs/rules/no-bar.md) | Description of no-bar. | ✅ | | ||
| [no-baz](docs/rules/no-baz.md) | Description of no-baz. | ✅ | | ||
| [no-biz](docs/rules/no-biz.md) | Description of no-biz. | ✅ | | ||
| [no-foo](docs/rules/no-foo.md) | Description of no-foo. | ✅ | | ||
|
||
<!-- end auto-generated rules list --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = { rules: { 'test/no-bar': 'error' } }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = { extends: require.resolve('./base-base-base-config.cjs') }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
module.exports = { | ||
extends: [require.resolve('./base-base-config.cjs')], | ||
rules: { 'test/no-foo': 'error' }, | ||
overrides: [ | ||
{ | ||
extends: [require.resolve('./override-config.cjs')], | ||
files: ['*.js'], | ||
rules: { 'test/no-baz': 'error' }, | ||
}, | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Description of no-bar (`test/no-bar`) | ||
|
||
💼 This rule is enabled in the ✅ `recommended` config. | ||
|
||
<!-- end auto-generated rule header --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Description of no-baz (`test/no-baz`) | ||
|
||
💼 This rule is enabled in the ✅ `recommended` config. | ||
|
||
<!-- end auto-generated rule header --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Description of no-biz (`test/no-biz`) | ||
|
||
💼 This rule is enabled in the ✅ `recommended` config. | ||
|
||
<!-- end auto-generated rule header --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Description of no-foo (`test/no-foo`) | ||
|
||
💼 This rule is enabled in the ✅ `recommended` config. | ||
|
||
<!-- end auto-generated rule header --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
module.exports = { | ||
rules: { | ||
'no-foo': { | ||
meta: { docs: { description: 'Description of no-foo.' } }, | ||
create() {}, | ||
}, | ||
'no-bar': { | ||
meta: { docs: { description: 'Description of no-bar.' } }, | ||
create() {}, | ||
}, | ||
'no-baz': { | ||
meta: { docs: { description: 'Description of no-baz.' } }, | ||
create() {}, | ||
}, | ||
'no-biz': { | ||
meta: { docs: { description: 'Description of no-biz.' } }, | ||
create() {}, | ||
}, | ||
}, | ||
configs: { | ||
recommended: { | ||
extends: [ | ||
require.resolve('./base-config.cjs'), | ||
// Should ignore these since they're external: | ||
'eslint:recommended', | ||
'plugin:some-plugin/recommended', | ||
'prettier', | ||
], | ||
}, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = { rules: { 'test/no-biz': 'error' } }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"name": "eslint-plugin-test", | ||
"type": "commonjs" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# eslint-plugin-test | ||
|
||
<!-- begin auto-generated rules list --> | ||
|
||
| Name | | ||
| :--- | | ||
|
||
<!-- end auto-generated rules list --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = { rules: {} }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"name": "eslint-plugin-test", | ||
"type": "commonjs", | ||
"main": "lib/index.cjs" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<!-- begin auto-generated rules list --> | ||
<!-- end auto-generated rules list --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"name": "eslint-plugin-test", | ||
"type": "commonjs", | ||
"main": "index.js" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# eslint-plugin-test | ||
|
||
<!-- begin auto-generated rules list --> | ||
|
||
| Name | | ||
| :--- | | ||
|
||
<!-- end auto-generated rules list --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = { rules: {} }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"name": "eslint-plugin-test", | ||
"type": "commonjs" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# eslint-plugin-test | ||
|
||
<!-- begin auto-generated rules list --> | ||
|
||
| Name | Description | | ||
| :----------------------------- | :------------ | | ||
| [no-foo](docs/rules/no-foo.md) | disallow foo. | | ||
|
||
<!-- end auto-generated rules list --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Disallow foo (`test/no-foo`) | ||
|
||
<!-- end auto-generated rule header --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
module.exports = { | ||
rules: { | ||
'no-foo': { | ||
meta: { docs: { description: 'disallow foo.' } }, | ||
create() {}, | ||
}, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"name": "eslint-plugin-test", | ||
"type": "commonjs" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`generate (cjs) basic generates the documentation 1`] = ` | ||
"# eslint-plugin-test | ||
<!-- begin auto-generated rules list --> | ||
| Name | Description | | ||
| :----------------------------- | :------------ | | ||
| [no-foo](docs/rules/no-foo.md) | disallow foo. | | ||
<!-- end auto-generated rules list --> | ||
" | ||
`; | ||
|
||
exports[`generate (cjs) basic generates the documentation 2`] = ` | ||
"# Disallow foo (\`test/no-foo\`) | ||
<!-- end auto-generated rule header --> | ||
" | ||
`; | ||
|
||
exports[`generate (cjs) config that extends another config generates the documentation 1`] = ` | ||
"# eslint-plugin-test | ||
## Rules | ||
<!-- begin auto-generated rules list --> | ||
💼 Configurations enabled in.\\ | ||
✅ Set in the \`recommended\` configuration. | ||
| Name | Description | 💼 | | ||
| :----------------------------- | :--------------------- | :- | | ||
| [no-bar](docs/rules/no-bar.md) | Description of no-bar. | ✅ | | ||
| [no-baz](docs/rules/no-baz.md) | Description of no-baz. | ✅ | | ||
| [no-biz](docs/rules/no-biz.md) | Description of no-biz. | ✅ | | ||
| [no-foo](docs/rules/no-foo.md) | Description of no-foo. | ✅ | | ||
<!-- end auto-generated rules list --> | ||
" | ||
`; | ||
|
||
exports[`generate (cjs) config that extends another config generates the documentation 2`] = ` | ||
"# Description of no-foo (\`test/no-foo\`) | ||
💼 This rule is enabled in the ✅ \`recommended\` config. | ||
<!-- end auto-generated rule header --> | ||
" | ||
`; | ||
|
||
exports[`generate (cjs) config that extends another config generates the documentation 3`] = ` | ||
"# Description of no-bar (\`test/no-bar\`) | ||
💼 This rule is enabled in the ✅ \`recommended\` config. | ||
<!-- end auto-generated rule header --> | ||
" | ||
`; | ||
|
||
exports[`generate (cjs) config that extends another config generates the documentation 4`] = ` | ||
"# Description of no-baz (\`test/no-baz\`) | ||
💼 This rule is enabled in the ✅ \`recommended\` config. | ||
<!-- end auto-generated rule header --> | ||
" | ||
`; | ||
|
||
exports[`generate (cjs) config that extends another config generates the documentation 5`] = ` | ||
"# Description of no-biz (\`test/no-biz\`) | ||
💼 This rule is enabled in the ✅ \`recommended\` config. | ||
<!-- end auto-generated rule header --> | ||
" | ||
`; |
Oops, something went wrong.