File size: 1,523 Bytes
fea495a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
0 && (module.exports = {
    getESLintPromptValues: null,
    getESLintStrictValue: null
});
function _export(target, all) {
    for(var name in all)Object.defineProperty(target, name, {
        enumerable: true,
        get: all[name]
    });
}
_export(exports, {
    getESLintPromptValues: function() {
        return getESLintPromptValues;
    },
    getESLintStrictValue: function() {
        return getESLintStrictValue;
    }
});
const _findup = /*#__PURE__*/ _interop_require_default(require("next/dist/compiled/find-up"));
function _interop_require_default(obj) {
    return obj && obj.__esModule ? obj : {
        default: obj
    };
}
const getESLintStrictValue = async (cwd)=>{
    const tsConfigLocation = await (0, _findup.default)('tsconfig.json', {
        cwd
    });
    const hasTSConfig = tsConfigLocation !== undefined;
    return {
        title: 'Strict',
        recommended: true,
        config: {
            extends: hasTSConfig ? [
                'next/core-web-vitals',
                'next/typescript'
            ] : 'next/core-web-vitals'
        }
    };
};
const getESLintPromptValues = async (cwd)=>{
    return [
        await getESLintStrictValue(cwd),
        {
            title: 'Base',
            config: {
                extends: 'next'
            }
        },
        {
            title: 'Cancel',
            config: null
        }
    ];
};

//# sourceMappingURL=getESLintPromptValues.js.map