-
-
Notifications
You must be signed in to change notification settings - Fork 24
feat!: support flat config #81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
41 commits
Select commit
Hold shift + click to select a range
cc4d8a6
feat!: support flat config
aladdin-add fcde6c3
fix: do not support multi configs
aladdin-add 8ddf82a
fix: helpercontent
aladdin-add 1199d6e
fix: review suggestions
aladdin-add 222e432
fix: rm unused dev deps
aladdin-add 4602713
fix: rm unused dev deps
aladdin-add a46bdf7
fix: add missing @eslint/eslintrc
aladdin-add 893522d
chore: clean fixtures
aladdin-add 595b5b7
fix: styleguide tests
aladdin-add 9fd59b0
feat: allow styleguide to be string (type = flat)
aladdin-add f994131
fix: sourceType: script
aladdin-add ed29ad7
fix: indent
aladdin-add 0cc0c41
fix: use `[].concat()` only for shared configs
aladdin-add d8d81d5
chore: c8 -> v8
aladdin-add 74e83ab
refactor: do not throw in constructor
aladdin-add ec2642f
fix: rm deps debug
aladdin-add 640d0d5
fix: shortname for scoped packages
aladdin-add 9a8affb
chore: put env in .npmrc
aladdin-add 399a0f7
fix: change cwd to the `package.json` located dir
aladdin-add 85a6fb2
fix: review suggestions
aladdin-add 07479e1
fix: generage config for sub-dir
aladdin-add d08ec84
Update lib/config-generator.js
aladdin-add 6fe2d6a
chore: add tests for sub dir
aladdin-add bd4232b
Update lib/config-generator.js
aladdin-add 082044d
Update lib/config-generator.js
aladdin-add bb8e042
fix: module => moduleType
aladdin-add 8354c9f
fix: only apply sourceType to js files
aladdin-add ca75216
fix: problem => problems
aladdin-add 71d5767
fix: eslint bin
aladdin-add 2f61590
fix: update snapshots
aladdin-add 1a6fe9d
chore: refactor export content
aladdin-add 5b83cf0
fix: review suggestions
aladdin-add 36ad1ec
Update README.md
aladdin-add c8011ce
Update lib/config-generator.js
aladdin-add a1eae82
Update README.md
aladdin-add 0c19e32
chore: update snapshots
aladdin-add cdc4430
feat: offical vue supports
aladdin-add 0551e86
fix: revert re-ordering
aladdin-add 0a4c547
fix: allow skipping installing deps
aladdin-add e7da8c7
Update lib/config-generator.js
aladdin-add fce14fd
chore: update snapshots
aladdin-add File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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,20 +1,20 @@ | ||
{ | ||
"configContent": "import pluginJs from "@eslint/js"; | ||
import globals from "globals"; | ||
import tseslint from "typescript-eslint"; | ||
import globals from "globals"; | ||
|
||
|
||
export default [ | ||
{files: ["**/*.js"], languageOptions: {sourceType: "commonjs"}}, | ||
pluginJs.configs.recommended, | ||
{languageOptions: { globals: {...globals.browser, ...globals.node} }}, | ||
...tseslint.configs.recommended, | ||
{files: ["**/*.js"], languageOptions: {sourceType: "commonjs"}}, | ||
{languageOptions: { globals: {...globals.browser, ...globals.node} }}, | ||
];", | ||
"configFilename": "eslint.config.js", | ||
"devDependencies": [ | ||
"eslint", | ||
"@eslint/js", | ||
"globals", | ||
"typescript-eslint", | ||
"globals", | ||
], | ||
} |
This file contains hidden or 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,20 +1,20 @@ | ||
{ | ||
"configContent": "import pluginJs from "@eslint/js"; | ||
import globals from "globals"; | ||
import pluginReactConfig from "eslint-plugin-react/configs/recommended.js"; | ||
import globals from "globals"; | ||
|
||
|
||
export default [ | ||
{files: ["**/*.js"], languageOptions: {sourceType: "commonjs"}}, | ||
pluginJs.configs.recommended, | ||
{languageOptions: { globals: {...globals.browser, ...globals.node} }}, | ||
pluginReactConfig, | ||
{files: ["**/*.js"], languageOptions: {sourceType: "commonjs"}}, | ||
{languageOptions: { globals: {...globals.browser, ...globals.node} }}, | ||
];", | ||
"configFilename": "eslint.config.js", | ||
"devDependencies": [ | ||
"eslint", | ||
"@eslint/js", | ||
"globals", | ||
"eslint-plugin-react", | ||
"globals", | ||
], | ||
} |
This file contains hidden or 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,23 +1,23 @@ | ||
{ | ||
"configContent": "import pluginJs from "@eslint/js"; | ||
import globals from "globals"; | ||
import tseslint from "typescript-eslint"; | ||
import pluginReactConfig from "eslint-plugin-react/configs/recommended.js"; | ||
import globals from "globals"; | ||
|
||
|
||
export default [ | ||
{files: ["**/*.js"], languageOptions: {sourceType: "commonjs"}}, | ||
pluginJs.configs.recommended, | ||
{languageOptions: { globals: {...globals.browser, ...globals.node} }}, | ||
...tseslint.configs.recommended, | ||
pluginReactConfig, | ||
{files: ["**/*.js"], languageOptions: {sourceType: "commonjs"}}, | ||
{languageOptions: { globals: {...globals.browser, ...globals.node} }}, | ||
];", | ||
"configFilename": "eslint.config.js", | ||
"devDependencies": [ | ||
"eslint", | ||
"@eslint/js", | ||
"globals", | ||
"typescript-eslint", | ||
"eslint-plugin-react", | ||
"globals", | ||
], | ||
} |
This file contains hidden or 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,30 +1,20 @@ | ||
{ | ||
"configContent": "import pluginJs from "@eslint/js"; | ||
import pluginVue from "eslint-plugin-vue"; | ||
import globals from "globals"; | ||
|
||
import path from "path"; | ||
import { fileURLToPath } from "url"; | ||
import { FlatCompat } from "@eslint/eslintrc"; | ||
import pluginJs from "@eslint/js"; | ||
|
||
// mimic CommonJS variables -- not needed if using CommonJS | ||
const __filename = fileURLToPath(import.meta.url); | ||
const __dirname = path.dirname(__filename); | ||
const compat = new FlatCompat({baseDirectory: __dirname, recommendedConfig: pluginJs.configs.recommended}); | ||
|
||
export default [ | ||
{files: ["**/*.js"], languageOptions: {sourceType: "commonjs"}}, | ||
pluginJs.configs.recommended, | ||
pluginVue.configs["flat/essential"], | ||
{files: ["**/*.js"], languageOptions: {sourceType: "commonjs"}}, | ||
{languageOptions: { globals: {...globals.browser, ...globals.node} }}, | ||
...compat.extends("plugin:vue/vue3-essential").map(config => ({files: ["**/*.vue"], ...config})), | ||
];", | ||
"configFilename": "eslint.config.js", | ||
"devDependencies": [ | ||
"eslint", | ||
"@eslint/js", | ||
"globals", | ||
"eslint-plugin-vue", | ||
"@eslint/eslintrc", | ||
"@eslint/js", | ||
"globals", | ||
], | ||
} |
This file contains hidden or 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,33 +1,23 @@ | ||
{ | ||
"configContent": "import pluginJs from "@eslint/js"; | ||
import globals from "globals"; | ||
import tseslint from "typescript-eslint"; | ||
import pluginVue from "eslint-plugin-vue"; | ||
import globals from "globals"; | ||
|
||
import path from "path"; | ||
import { fileURLToPath } from "url"; | ||
import { FlatCompat } from "@eslint/eslintrc"; | ||
import pluginJs from "@eslint/js"; | ||
|
||
// mimic CommonJS variables -- not needed if using CommonJS | ||
const __filename = fileURLToPath(import.meta.url); | ||
const __dirname = path.dirname(__filename); | ||
const compat = new FlatCompat({baseDirectory: __dirname, recommendedConfig: pluginJs.configs.recommended}); | ||
|
||
export default [ | ||
{files: ["**/*.js"], languageOptions: {sourceType: "commonjs"}}, | ||
pluginJs.configs.recommended, | ||
{languageOptions: { globals: {...globals.browser, ...globals.node} }}, | ||
...tseslint.configs.recommended, | ||
...compat.extends("plugin:vue/vue3-essential").map(config => ({files: ["**/*.vue"], ...config})), | ||
pluginVue.configs["flat/essential"], | ||
{files: ["**/*.js"], languageOptions: {sourceType: "commonjs"}}, | ||
{languageOptions: { globals: {...globals.browser, ...globals.node} }}, | ||
];", | ||
"configFilename": "eslint.config.js", | ||
"devDependencies": [ | ||
"eslint", | ||
"@eslint/js", | ||
"globals", | ||
"typescript-eslint", | ||
"eslint-plugin-vue", | ||
"@eslint/eslintrc", | ||
"@eslint/js", | ||
"globals", | ||
], | ||
} |
This file contains hidden or 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,19 +1,19 @@ | ||
{ | ||
"configContent": "import pluginJs from "@eslint/js"; | ||
import globals from "globals"; | ||
import tseslint from "typescript-eslint"; | ||
import globals from "globals"; | ||
|
||
|
||
export default [ | ||
pluginJs.configs.recommended, | ||
{languageOptions: { globals: {...globals.browser, ...globals.node} }}, | ||
...tseslint.configs.recommended, | ||
{languageOptions: { globals: {...globals.browser, ...globals.node} }}, | ||
];", | ||
"configFilename": "eslint.config.js", | ||
"devDependencies": [ | ||
"eslint", | ||
"@eslint/js", | ||
"globals", | ||
"typescript-eslint", | ||
"globals", | ||
], | ||
} |
This file contains hidden or 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,19 +1,19 @@ | ||
{ | ||
"configContent": "import pluginJs from "@eslint/js"; | ||
import globals from "globals"; | ||
import pluginReactConfig from "eslint-plugin-react/configs/recommended.js"; | ||
import globals from "globals"; | ||
|
||
|
||
export default [ | ||
pluginJs.configs.recommended, | ||
{languageOptions: { globals: {...globals.browser, ...globals.node} }}, | ||
pluginReactConfig, | ||
{languageOptions: { globals: {...globals.browser, ...globals.node} }}, | ||
];", | ||
"configFilename": "eslint.config.js", | ||
"devDependencies": [ | ||
"eslint", | ||
"@eslint/js", | ||
"globals", | ||
"eslint-plugin-react", | ||
"globals", | ||
], | ||
} |
This file contains hidden or 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,22 +1,22 @@ | ||
{ | ||
"configContent": "import pluginJs from "@eslint/js"; | ||
import globals from "globals"; | ||
import tseslint from "typescript-eslint"; | ||
import pluginReactConfig from "eslint-plugin-react/configs/recommended.js"; | ||
import globals from "globals"; | ||
|
||
|
||
export default [ | ||
pluginJs.configs.recommended, | ||
{languageOptions: { globals: {...globals.browser, ...globals.node} }}, | ||
...tseslint.configs.recommended, | ||
pluginReactConfig, | ||
{languageOptions: { globals: {...globals.browser, ...globals.node} }}, | ||
];", | ||
"configFilename": "eslint.config.js", | ||
"devDependencies": [ | ||
"eslint", | ||
"@eslint/js", | ||
"globals", | ||
"typescript-eslint", | ||
"eslint-plugin-react", | ||
"globals", | ||
], | ||
} |
This file contains hidden or 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,29 +1,19 @@ | ||
{ | ||
"configContent": "import pluginJs from "@eslint/js"; | ||
import pluginVue from "eslint-plugin-vue"; | ||
import globals from "globals"; | ||
|
||
import path from "path"; | ||
import { fileURLToPath } from "url"; | ||
import { FlatCompat } from "@eslint/eslintrc"; | ||
import pluginJs from "@eslint/js"; | ||
|
||
// mimic CommonJS variables -- not needed if using CommonJS | ||
const __filename = fileURLToPath(import.meta.url); | ||
const __dirname = path.dirname(__filename); | ||
const compat = new FlatCompat({baseDirectory: __dirname, recommendedConfig: pluginJs.configs.recommended}); | ||
|
||
export default [ | ||
pluginJs.configs.recommended, | ||
pluginVue.configs["flat/essential"], | ||
{languageOptions: { globals: {...globals.browser, ...globals.node} }}, | ||
...compat.extends("plugin:vue/vue3-essential").map(config => ({files: ["**/*.vue"], ...config})), | ||
];", | ||
"configFilename": "eslint.config.js", | ||
"devDependencies": [ | ||
"eslint", | ||
"@eslint/js", | ||
"globals", | ||
"eslint-plugin-vue", | ||
"@eslint/eslintrc", | ||
"@eslint/js", | ||
"globals", | ||
], | ||
} |
This file contains hidden or 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,32 +1,22 @@ | ||
{ | ||
"configContent": "import pluginJs from "@eslint/js"; | ||
import globals from "globals"; | ||
import tseslint from "typescript-eslint"; | ||
import pluginVue from "eslint-plugin-vue"; | ||
import globals from "globals"; | ||
|
||
import path from "path"; | ||
import { fileURLToPath } from "url"; | ||
import { FlatCompat } from "@eslint/eslintrc"; | ||
import pluginJs from "@eslint/js"; | ||
|
||
// mimic CommonJS variables -- not needed if using CommonJS | ||
const __filename = fileURLToPath(import.meta.url); | ||
const __dirname = path.dirname(__filename); | ||
const compat = new FlatCompat({baseDirectory: __dirname, recommendedConfig: pluginJs.configs.recommended}); | ||
|
||
export default [ | ||
pluginJs.configs.recommended, | ||
{languageOptions: { globals: {...globals.browser, ...globals.node} }}, | ||
...tseslint.configs.recommended, | ||
...compat.extends("plugin:vue/vue3-essential").map(config => ({files: ["**/*.vue"], ...config})), | ||
pluginVue.configs["flat/essential"], | ||
{languageOptions: { globals: {...globals.browser, ...globals.node} }}, | ||
];", | ||
"configFilename": "eslint.config.js", | ||
"devDependencies": [ | ||
"eslint", | ||
"@eslint/js", | ||
"globals", | ||
"typescript-eslint", | ||
"eslint-plugin-vue", | ||
"@eslint/eslintrc", | ||
"@eslint/js", | ||
"globals", | ||
], | ||
} |
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.