-
Notifications
You must be signed in to change notification settings - Fork 0
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 #7 from alienfast/reuse-rulesets
Separate limits for individual use, alter recommended to be the most common use
- Loading branch information
Showing
14 changed files
with
107 additions
and
37 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,13 @@ | ||
import tseslint from 'typescript-eslint' | ||
|
||
import { configs } from './src/index.js' | ||
import af from './src/index.js' | ||
|
||
/** | ||
* Project eslint configuration. | ||
* | ||
* View config with `npx @eslint/config-inspector` | ||
*/ | ||
export default tseslint.config({ | ||
name: 'project', | ||
extends: [...configs.recommended], | ||
// ignore since we are using just js, until we eventually switch this to ts | ||
rules: { | ||
'@typescript-eslint/no-unsafe-argument': 'off', | ||
'@typescript-eslint/no-unsafe-member-access': 'off', | ||
'@typescript-eslint/no-unused-vars': 'off', | ||
'@typescript-eslint/no-unsafe-assignment': 'off', | ||
'@typescript-eslint/no-unsafe-call': 'off', | ||
'@typescript-eslint/no-unsafe-return': 'off', | ||
}, | ||
extends: [...af.configs.recommended, ...af.limits.jsOnly], | ||
}) |
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
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 |
---|---|---|
@@ -1,4 +1,3 @@ | ||
/* eslint-disable no-console */ | ||
import { dirname } from 'node:path' | ||
import { fileURLToPath } from 'node:url' | ||
|
||
|
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,13 @@ | ||
import jsOnlyScripts from '../limits/jsOnlyScripts.js' | ||
import js from './js.js' | ||
import json from './json.js' | ||
import markdown from './markdown.js' | ||
|
||
const configs = { | ||
js, | ||
json, | ||
markdown, | ||
recommended: [...js, ...jsOnlyScripts, ...json, ...markdown], | ||
other: [...markdown, ...json], | ||
} | ||
export default configs |
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
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
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 |
---|---|---|
@@ -1,13 +1,9 @@ | ||
import js from './js.js' | ||
import json from './json.js' | ||
import markdown from './markdown.js' | ||
import configs from './configs/index.js' | ||
import * as constants from './constants.js' | ||
import limits from './limits/index.js' | ||
|
||
export default {} | ||
export * from './constants.js' | ||
|
||
export const configs = { | ||
js, | ||
json, | ||
markdown, | ||
recommended: [...js, ...json, ...markdown], | ||
export default { | ||
constants, | ||
configs, | ||
limits, | ||
} |
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 @@ | ||
import jsOnly from './jsOnly.js' | ||
import jsOnlyScripts from './jsOnlyScripts.js' | ||
|
||
const ruleset = { | ||
jsOnly, | ||
jsOnlyScripts, | ||
} | ||
export default ruleset |
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,23 @@ | ||
import tseslint from 'typescript-eslint' | ||
|
||
/** | ||
* Turn off rules not necessary for js only files. | ||
* | ||
* Do not extend configs, it will alter files/ignores behavior. | ||
* | ||
* View config with `npx @eslint/config-inspector` | ||
*/ | ||
const configs = tseslint.config({ | ||
name: 'alienfast-js-only', | ||
rules: { | ||
'@typescript-eslint/no-unsafe-argument': 'off', | ||
'@typescript-eslint/no-unsafe-member-access': 'off', | ||
'@typescript-eslint/no-unused-vars': 'off', | ||
'@typescript-eslint/no-unsafe-assignment': 'off', | ||
'@typescript-eslint/no-unsafe-call': 'off', | ||
'@typescript-eslint/no-unsafe-return': 'off', | ||
'@typescript-eslint/no-floating-promises': 'off', | ||
}, | ||
}) | ||
|
||
export default configs |
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,22 @@ | ||
import tseslint from 'typescript-eslint' | ||
|
||
import { SCRIPTS } from '../constants.js' | ||
import jsOnly from './jsOnly.js' | ||
|
||
/** | ||
* Turn off rules not necessary for scripts | ||
* | ||
* Do not extend configs, it will alter files/ignores behavior. | ||
* | ||
* View config with `npx @eslint/config-inspector` | ||
*/ | ||
const configs = tseslint.config({ | ||
name: 'alienfast-js-only-scripts', | ||
extends: [...jsOnly], | ||
files: SCRIPTS, | ||
rules: { | ||
'no-console': 'off', | ||
}, | ||
}) | ||
|
||
export default configs |
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